mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 09:05:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
ca72710937 | ||
|
|
9a1688599a | ||
|
|
d6c3df32d6 | ||
|
|
28c0ffe333 | ||
|
|
586c24f9d6 | ||
|
|
31c0a70f8e | ||
|
|
64a92530d9 | ||
|
|
4441935a4a | ||
|
|
f1feac76b3 | ||
|
|
d9c4446ccc | ||
|
|
f83500db11 | ||
|
|
fd02d81e73 | ||
|
|
0d379fdd6b | ||
|
|
f6fd800242 | ||
|
|
c25214aaf4 | ||
|
|
c6afb2be3f | ||
|
|
13501a8b05 | ||
|
|
dae5994e9d | ||
|
|
b28a418bd9 | ||
|
|
64f69cf5c9 | ||
|
|
8084ca43b9 | ||
|
|
2e5f25d8ae | ||
|
|
04b0d24678 | ||
|
|
153e7a1806 | ||
|
|
065ebd748a | ||
|
|
79c17cb542 | ||
|
|
9245975955 | ||
|
|
6ea19ec8bf | ||
|
|
b527bf8ab3 | ||
|
|
0b1b3c68fa | ||
|
|
d930c8ae8b | ||
|
|
053c5300ed | ||
|
|
e8ae18efda | ||
|
|
39965c55ac | ||
|
|
f87dca2ad4 | ||
|
|
3e02903d19 | ||
|
|
febae7f8f2 | ||
|
|
71dd5c9f4d | ||
|
|
aa91af865d | ||
|
|
9119e395d4 | ||
|
|
68433924c7 | ||
|
|
87b67cb45a | ||
|
|
77dd9eb883 | ||
|
|
e000fd2f8f | ||
|
|
e4d20a80ed | ||
|
|
36866fed10 | ||
|
|
55691fce4e | ||
|
|
d2a3b5bed8 | ||
|
|
6365674a2a | ||
|
|
7a02ccc3a8 | ||
|
|
2918864248 | ||
|
|
9fbfe2b98e | ||
|
|
b40e2cc59e | ||
|
|
3eac9c536b | ||
|
|
ad32b01d85 | ||
|
|
da33233762 | ||
|
|
c2a7fe4019 | ||
|
|
0067d3edce | ||
|
|
ebf038231e | ||
|
|
f767b7096c | ||
|
|
161227b1de | ||
|
|
8e43dfa7a6 | ||
|
|
0a11ffb827 | ||
|
|
3c55b46ca0 | ||
|
|
7d21e5d328 | ||
|
|
043069dc8a | ||
|
|
ea26434987 | ||
|
|
9ee34f57f5 | ||
|
|
d539dc12a1 | ||
|
|
c578cae676 | ||
|
|
8b74b32909 | ||
|
|
1d1133123b | ||
|
|
0bdafb976e | ||
|
|
13f9418201 | ||
|
|
a771a3ea06 | ||
|
|
39633eef4f | ||
|
|
1f11ac76fa | ||
|
|
2e1456517a | ||
|
|
4db208332e | ||
|
|
659091c565 | ||
|
|
c8c54113d0 | ||
|
|
69f8e57cea | ||
|
|
06a6fac23a | ||
|
|
fa939a890c | ||
|
|
2c8ab76240 | ||
|
|
7a651b8c1f | ||
|
|
d04df43b27 | ||
|
|
d3c9db906f | ||
|
|
f6e2c5c1f0 | ||
|
|
cc682fd786 | ||
|
|
6643997304 | ||
|
|
7b867d0069 | ||
|
|
a15c4dc9b0 | ||
|
|
7c11fe1022 | ||
|
|
66f816971f | ||
|
|
98c6d5a5f6 | ||
|
|
0b2a98f956 | ||
|
|
c01b336095 | ||
|
|
040cc4bf16 | ||
|
|
eefc4d3e84 | ||
|
|
c3c979f11a | ||
|
|
276d0c49c1 | ||
|
|
7c840dce35 | ||
|
|
2bee5f7ac6 | ||
|
|
60524f0f3e | ||
|
|
1170772a4f | ||
|
|
f4d2d1a24b | ||
|
|
ff2e35c243 | ||
|
|
0d1a2f2af3 | ||
|
|
3b029ba031 | ||
|
|
cd21f7b927 | ||
|
|
755eff7415 | ||
|
|
0d3f28bd52 | ||
|
|
56a3926b86 | ||
|
|
220bf8730a | ||
|
|
118eac8f39 | ||
|
|
99452a8b45 | ||
|
|
eb42614288 | ||
|
|
5238eca241 | ||
|
|
94af6c7f9d | ||
|
|
f2b54acd67 | ||
|
|
497bc10d0a | ||
|
|
c1bb5cb250 | ||
|
|
51910fe83b | ||
|
|
958bbf6c9a | ||
|
|
e98951ee65 | ||
|
|
3765d912a5 | ||
|
|
849bc00b46 | ||
|
|
f3715c3e2e | ||
|
|
985a48f02e | ||
|
|
4e196a445a | ||
|
|
36d2e67b07 | ||
|
|
34568a0a74 | ||
|
|
f7acc73282 | ||
|
|
60926ad6ea | ||
|
|
f734e614e4 | ||
|
|
997a15c0f2 | ||
|
|
1b40618f02 | ||
|
|
58c78560fa | ||
|
|
1d1ec57909 | ||
|
|
fd9c83b65f | ||
|
|
6baddc7e26 | ||
|
|
e9580877b4 | ||
|
|
440649bb95 | ||
|
|
48846bc0ba | ||
|
|
558e1d2fb0 | ||
|
|
0b26047ea8 | ||
|
|
7f5a57f4af | ||
|
|
dc12cda505 | ||
|
|
b4cf6f7f36 | ||
|
|
f2f04407a4 | ||
|
|
8a11e3bac4 | ||
|
|
4879b0611a | ||
|
|
d11a67499d | ||
|
|
b3b8c78527 | ||
|
|
0bfa76251d | ||
|
|
a992a4325b | ||
|
|
c1225f3876 | ||
|
|
152836c907 | ||
|
|
e47a4ea514 | ||
|
|
52b6da1759 | ||
|
|
f13465012b | ||
|
|
b7b5dd5bea | ||
|
|
7265900c62 | ||
|
|
7a77298a60 | ||
|
|
0177e7558e | ||
|
|
719ea50d1a | ||
|
|
bbf1ea41b8 | ||
|
|
eb22f42fea | ||
|
|
dd32e74e34 | ||
|
|
e1b4a150c3 | ||
|
|
76d912c0ba | ||
|
|
a3c8e04ee6 | ||
|
|
bf9158172f | ||
|
|
b687180e12 | ||
|
|
47a11b9a7e | ||
|
|
b6ddb0a7cf | ||
|
|
acb7acd661 | ||
|
|
7c0d94ce9c | ||
|
|
763b3e806e | ||
|
|
b5264cacf0 | ||
|
|
f1552ef20d | ||
|
|
de7eeed916 | ||
|
|
93eabce1bc | ||
|
|
e693dd4923 | ||
|
|
7f9acac469 | ||
|
|
506d5b18de | ||
|
|
5110796591 | ||
|
|
eafeba9fed | ||
|
|
b7a1676b15 | ||
|
|
72b63e7b36 | ||
|
|
fe3fcef7a9 | ||
|
|
714b09ddcb |
No files matched your search
@@ -13,3 +13,4 @@
|
||||
*.pyd binary
|
||||
*.cfg text eol=lf
|
||||
*.py text eol=lf
|
||||
*.jks binary
|
||||
+3
-5
@@ -6,15 +6,15 @@ staleLabel: Stale
|
||||
unmarkComment: false
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 1
|
||||
# Issues with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- Assigned
|
||||
|
||||
pulls:
|
||||
# Number of days of inactivity before a Pull Request becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale Pull Request is closed
|
||||
daysUntilClose: 14
|
||||
# Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- Assigned
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This pull request has been automatically marked as stale because it has not had recent
|
||||
@@ -30,8 +30,6 @@ issues:
|
||||
daysUntilStale: 180
|
||||
# Number of days of inactivity before a stale Issue is closed
|
||||
daysUntilClose: 14
|
||||
# Issues with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels: []
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had activity
|
||||
|
||||
+7
-5
@@ -19,7 +19,13 @@
|
||||
/mdk/build
|
||||
|
||||
#occupational hazards
|
||||
/projects/
|
||||
/projects/mcp/
|
||||
/projects/clean/
|
||||
/projects/forge/
|
||||
/projects/**/build/
|
||||
/projects/**/out/
|
||||
/projects/**/run/
|
||||
/projects/**/*.launch
|
||||
/repo/
|
||||
/buildSrc
|
||||
|
||||
@@ -29,10 +35,6 @@
|
||||
|
||||
# FML changelog
|
||||
changelog.txt
|
||||
/patches_old/
|
||||
/patches_old_bak/
|
||||
/patches/minecraft.old/
|
||||
/projects.old/
|
||||
*.py
|
||||
*.7z
|
||||
/logs/
|
||||
|
||||
@@ -28,3 +28,11 @@ script:
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
# skip building travis on 1.13+ - it doesn't work there
|
||||
branches:
|
||||
except:
|
||||
- 1.13-pre
|
||||
- 1.13.x
|
||||
- 1.14.x
|
||||
- /^noci-.*$/
|
||||
+1
-1
@@ -10,7 +10,7 @@ alpha. Eloraam of RedPower, and SpaceToad of Buildcraft, without their acceptian
|
||||
of me taking over the project, who knows what Minecraft modding would be today.
|
||||
|
||||
Secondly, someone who has worked with me, and developed some of the core features
|
||||
that allow modding to he as functional, and as simple as it is, cpw. For developing
|
||||
that allow modding to be as functional, and as simple as it is, cpw. For developing
|
||||
FML, which stabelized the client and server modding ecosystem. As well as the base
|
||||
loading system that allows us to modify Minecraft's code as elegently as possible.
|
||||
|
||||
|
||||
Vendored
+80
-35
@@ -1,6 +1,9 @@
|
||||
@Library('forge-shared-library')_
|
||||
|
||||
pipeline {
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
agent {
|
||||
docker {
|
||||
image 'gradlewrapper:latest'
|
||||
@@ -8,58 +11,100 @@ pipeline {
|
||||
}
|
||||
}
|
||||
environment {
|
||||
GRADLE_ARGS = --no-daemon' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
|
||||
GRADLE_ARGS = '--no-daemon --console=plain' // No daemon for now as FG3 kinda derps. //'-Dorg.gradle.daemon.idletimeout=5000'
|
||||
DISCORD_WEBHOOK = credentials('forge-discord-jenkins-webhook')
|
||||
DISCORD_PREFIX = "Job: Forge Branch: ${BRANCH_NAME} Build: #${BUILD_NUMBER}"
|
||||
JENKINS_HEAD = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('fetch') {
|
||||
steps {
|
||||
git(url: 'https://github.com/MinecraftForge/MinecraftForge.git', changelog: true)
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
cache(maxCacheSize: 250/*MB*/, caches: [
|
||||
[$class: 'ArbitraryFileCache', excludes: 'log.txt', includes: '**/*', path: '${WORKSPACE}/projects/forge/build/extractRangeMap'] //Cache the rangemap to help speed up builds
|
||||
]){
|
||||
stage('buildandtest') {
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue build test'
|
||||
script {
|
||||
env.MYVERSION = sh(returnStdout: true, script: './gradlew properties -q | grep "version:" | awk \'{print $2}\'').trim()
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
archiveArtifacts artifacts: 'build/changelog.txt', fingerprint: false
|
||||
}
|
||||
stage('notify_start') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
steps {
|
||||
discordSend(
|
||||
title: "${DISCORD_PREFIX} Started",
|
||||
successful: true,
|
||||
result: 'ABORTED', //White border
|
||||
thumbnail: JENKINS_HEAD,
|
||||
webhookURL: DISCORD_WEBHOOK
|
||||
)
|
||||
}
|
||||
}
|
||||
stage('setup') {
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies --continue setup'
|
||||
script {
|
||||
env.MYVERSION = sh(returnStdout: true, script: './gradlew :forge:properties -q | grep "version:" | awk \'{print $2}\'').trim()
|
||||
}
|
||||
environment {
|
||||
FORGE_MAVEN = credentials('forge-maven-forge-user')
|
||||
CROWDIN = credentials('forge-crowdin')
|
||||
KEYSTORE = credentials('forge-jenkins-keystore-old')
|
||||
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
}
|
||||
}
|
||||
stage('changelog') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
//We're testing so use the test group
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.test.forge/${MYVERSION}'
|
||||
}
|
||||
steps {
|
||||
writeChangelog(currentBuild, 'build/changelog.txt')
|
||||
}
|
||||
}
|
||||
stage('publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
environment {
|
||||
FORGE_MAVEN = credentials('forge-maven-forge-user')
|
||||
CROWDIN = credentials('forge-crowdin')
|
||||
KEYSTORE = credentials('forge-jenkins-keystore-old')
|
||||
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
|
||||
}
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
|
||||
sh 'curl --user ${FORGE_MAVEN} http://files.minecraftforge.net/maven/manage/promote/latest/net.minecraftforge.forge/${MYVERSION}'
|
||||
}
|
||||
}
|
||||
stage('test_publish_pr') { //Publish to local repo to test full process, but don't include credentials so it can't sign/publish to maven
|
||||
when {
|
||||
changeRequest()
|
||||
}
|
||||
environment {
|
||||
CROWDIN = credentials('forge-crowdin')
|
||||
}
|
||||
steps {
|
||||
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts artifacts: 'build/libs/**/*.jar', 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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
Minecraft Forge
|
||||
Copyright (c) 2016-2018.
|
||||
Copyright (c) 2016-2019.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ parts herein are licensed under the terms of the LGPL 2.1 found
|
||||
here http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt and
|
||||
copied below.
|
||||
|
||||
Homepage: http://MinecraftForge.net/
|
||||
http://github.com/MinecraftForge/MinecraftForge
|
||||
Homepage: http://minecraftforge.net/
|
||||
https://github.com/MinecraftForge/MinecraftForge
|
||||
|
||||
|
||||
A note on authorship:
|
||||
|
||||
+411
-229
@@ -1,7 +1,7 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url = 'http://files.minecraftforge.net/maven' }
|
||||
maven { url = 'https://files.minecraftforge.net/maven' }
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -22,18 +22,38 @@ import net.minecraftforge.gradle.common.task.SignJar
|
||||
import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
|
||||
import java.util.stream.Collectors
|
||||
|
||||
plugins {
|
||||
id 'net.minecrell.licenser' version '0.4'
|
||||
id 'org.ajoberstar.grgit' version '2.3.0'
|
||||
id 'de.undercouch.download' version '3.3.0'
|
||||
id 'com.github.ben-manes.versions' version '0.20.0'
|
||||
}
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
ext {
|
||||
JAR_SIGNER = null
|
||||
if (project.hasProperty('keystore')) {
|
||||
JAR_SIGNER = [
|
||||
storepass: project.properties.keystoreStorePass,
|
||||
keypass: project.properties.keystoreKeyPass,
|
||||
keystore: project.properties.keystore
|
||||
]
|
||||
}
|
||||
MAPPING_CHANNEL = 'snapshot'
|
||||
MAPPING_VERSION = '20190526-1.13.2'
|
||||
MC_VERSION = '1.14.2'
|
||||
MCP_VERSION = '20190603.175704'
|
||||
}
|
||||
|
||||
project(':mcp') {
|
||||
apply plugin: 'net.minecraftforge.gradle.forgedev.mcp'
|
||||
apply plugin: 'net.minecraftforge.gradle.mcp'
|
||||
mcp {
|
||||
config = '1.13-2018.09.12.04.11.00'
|
||||
config = MC_VERSION + '-' + MCP_VERSION
|
||||
pipeline = 'joined'
|
||||
}
|
||||
}
|
||||
@@ -41,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')
|
||||
mcVersion = MC_VERSION
|
||||
patchedSrc = file('src/main/java')
|
||||
mappings channel: 'snapshot', version: '20180921-1.13'
|
||||
mcVersion = '1.13'
|
||||
}
|
||||
task runclient(type: JavaExec) {
|
||||
doFirst {
|
||||
mkdir 'runclient'
|
||||
|
||||
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', '1.13']
|
||||
main 'net.minecraft.client.main.Main'
|
||||
workingDir 'runclient'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,68 +107,72 @@ 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.
|
||||
|
||||
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
group = 'net.minecraftforge'
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
fmllauncher {
|
||||
java {
|
||||
srcDir "$rootDir/src/main/java"
|
||||
srcDirs = ["$rootDir/src/fmllauncher/java"]
|
||||
}
|
||||
resources {
|
||||
srcDir "$rootDir/src/main/resources"
|
||||
srcDirs = ["$rootDir/src/fmllauncher/resources"]
|
||||
}
|
||||
}
|
||||
main {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDirs = ["$rootDir/src/main/java"]
|
||||
}
|
||||
resources {
|
||||
srcDirs = ["$rootDir/src/main/resources"]
|
||||
}
|
||||
}
|
||||
test {
|
||||
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
|
||||
java {
|
||||
srcDirs = [
|
||||
//"$rootDir/src/test/java",
|
||||
//"$rootDir/src/fmllaunchertest/java"
|
||||
]
|
||||
}
|
||||
resources {
|
||||
srcDirs = ["$rootDir/src/test/resources"]
|
||||
}
|
||||
}
|
||||
userdev {
|
||||
compileClasspath += sourceSets.main.runtimeClasspath
|
||||
runtimeClasspath += sourceSets.main.runtimeClasspath
|
||||
java {
|
||||
srcDirs = ["$rootDir/src/userdev/java"]
|
||||
}
|
||||
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 {
|
||||
MC_VERSION = '1.13'
|
||||
SPEC_VERSION = '24.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
SPEC_VERSION = '26.0' // This is overwritten by git tag, but here so dev time doesnt explode
|
||||
// The new versioning sceme is <MCVersion>-<ForgeMC>.<RB>.<CommitsSinceRB>
|
||||
// ForgeMC is a unique identifier for every MC version we have supported.
|
||||
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
|
||||
MCP_ARTIFACT = project(':mcp').mcp.config
|
||||
MCP_VERSION = project(':mcp').mcp.config.version.split('-')[1] // The timestamp only.
|
||||
|
||||
if (project.hasProperty('keystore')) {
|
||||
jarsigner = [
|
||||
storepass: project.properties.keystoreStorePass,
|
||||
keypass: project.properties.keystoreKeyPass,
|
||||
keystore: project.properties.keystore
|
||||
]
|
||||
}
|
||||
}
|
||||
patcher {
|
||||
parent = project(':clean')
|
||||
patches = file("$rootDir/patches/minecraft")
|
||||
patchedSrc = file('src/main/java')
|
||||
accessTransformer = file("$rootDir/src/main/resources/forge_at.cfg")
|
||||
exc = file("$rootDir/src/main/resources/forge.exc")
|
||||
srgPatches = true
|
||||
clientRun {
|
||||
main = 'net.minecraftforge.fml.LaunchTesting'
|
||||
environment = [
|
||||
target: 'fmldevclient'
|
||||
]
|
||||
properties = [
|
||||
target: 'fmldevclient',
|
||||
assetDirectory: downloadAssets.output
|
||||
]
|
||||
}
|
||||
serverRun {
|
||||
main = 'net.minecraftforge.fml.LaunchTesting'
|
||||
environment = [
|
||||
target: 'fmldevserver'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def getVersion = {
|
||||
//TAG-offset-hash
|
||||
def raw = grgit.describe(longDescr: true)
|
||||
@@ -142,11 +186,133 @@ project(':forge') {
|
||||
if (branch != null && branch.endsWith('.x') && MC_VERSION.startsWith(branch.substring(0, branch.length() - 2))) //1.13.x
|
||||
branch = null
|
||||
SPEC_VERSION = tag
|
||||
return "${tag}.${offset}${t -> if (branch != null) t << '-' + branch}"
|
||||
return "${MC_VERSION}-${tag}.${offset}${t -> if (branch != null) t << '-' + branch}".toString() //Bake the response instead of making it dynamic
|
||||
}
|
||||
|
||||
version = getVersion()
|
||||
|
||||
patcher {
|
||||
exc = file("$rootDir/src/main/resources/forge.exc")
|
||||
parent = project(':clean')
|
||||
patches = file("$rootDir/patches/minecraft")
|
||||
patchedSrc = file('src/main/java')
|
||||
srgPatches = true
|
||||
accessTransformer = file("$rootDir/src/main/resources/META-INF/accesstransformer.cfg")
|
||||
|
||||
runs {
|
||||
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_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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
MANIFESTS = [
|
||||
'/': [
|
||||
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
'GitCommit': grgit.head().abbreviatedId,
|
||||
'Git-Branch': grgit.branch.current().getName()
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/versions/forge/': [
|
||||
'Specification-Title': 'Forge',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': SPEC_VERSION,
|
||||
'Implementation-Title': project.group,
|
||||
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
|
||||
'Implementation-Vendor': 'Forge Development LLC'
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/versions/mcp/': [
|
||||
'Specification-Title': 'Minecraft',
|
||||
'Specification-Vendor': 'Mojang',
|
||||
'Specification-Version': MC_VERSION,
|
||||
'Implementation-Title': 'MCP',
|
||||
'Implementation-Version': MCP_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/fml/javafmlmod/': [
|
||||
'Specification-Title': 'Mod Language Provider',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': '1',
|
||||
'Implementation-Title': 'FML Java Mod',
|
||||
'Implementation-Version': SPEC_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap,
|
||||
'net/minecraftforge/fml/loading/': [
|
||||
'Specification-Title': 'Launcher',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': '1',
|
||||
'Implementation-Title': 'FML Launcher',
|
||||
'Implementation-Version': SPEC_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap
|
||||
]
|
||||
}
|
||||
|
||||
group = 'net.minecraftforge.test' //TODO: remove when we jenkins is working
|
||||
version = getVersion()
|
||||
applyPatches {
|
||||
canonicalizeAccess true
|
||||
canonicalizeWhitespace true
|
||||
@@ -157,89 +323,44 @@ project(':forge') {
|
||||
transitive = false //Don't pull all libraries, if we're missing something, add it to the installer list so the installer knows to download it.
|
||||
}
|
||||
api.extendsFrom(installer)
|
||||
fmllauncherImplementation.extendsFrom(installer)
|
||||
}
|
||||
dependencies {
|
||||
api 'net.minecraft:client:1.13:extra'
|
||||
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.1.0'
|
||||
installer 'net.minecraftforge:accesstransformers:0.10+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.1+:service'
|
||||
installer 'net.minecraftforge:forgespi:0.1+'
|
||||
installer 'net.minecraftforge:coremods:0.1+'
|
||||
installer 'com.electronwill.night-config:core:3.4.0'
|
||||
installer 'com.electronwill.night-config:toml:3.4.0'
|
||||
installer 'org.jline:jline:3.5.1'
|
||||
installer 'org.apache.maven:maven-artifact:3.5.3'
|
||||
installer 'net.jodah:typetools:0.5.0'
|
||||
installer 'cpw.mods:modlauncher:2.1.+'
|
||||
installer 'cpw.mods:grossjava9hacks:1.1.+'
|
||||
installer 'net.minecraftforge:accesstransformers:0.16.+:shadowed'
|
||||
installer 'net.minecraftforge:eventbus:0.9.+: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'
|
||||
}
|
||||
|
||||
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 'net.minecraftforge.fml.LaunchTesting'
|
||||
systemProperties = [
|
||||
"org.lwjgl.util.Debug": "true",
|
||||
"org.lwjgl.util.DebugLoader": "true",
|
||||
"mc.version": "${MC_VERSION}",
|
||||
"mcp.version": "${MCP_VERSION}",
|
||||
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
||||
"forge.spec":"${SPEC_VERSION}"
|
||||
]
|
||||
environment += [
|
||||
target:'fmldevclient',
|
||||
assetDirectory: file("${gradle.getGradleUserHomeDir()}/caches/forge_gradle/assets/"),
|
||||
nativesDirectory: extractNatives.output
|
||||
]
|
||||
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 'net.minecraftforge.fml.LaunchTesting'
|
||||
args 'nogui'
|
||||
systemProperties = [
|
||||
"mc.version": "${MC_VERSION}",
|
||||
"mcp.version": "${MCP_VERSION}",
|
||||
"forge.version": "${project.version.substring(MC_VERSION.length() + 1)}",
|
||||
"forge.spec":"${SPEC_VERSION}"
|
||||
]
|
||||
environment target:'fmldevserver'
|
||||
workingDir 'runserver'
|
||||
standardInput = System.in
|
||||
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
|
||||
}
|
||||
|
||||
def extraTxts = [
|
||||
rootProject.file('CREDITS.txt'),
|
||||
rootProject.file('LICENSE.txt')
|
||||
]
|
||||
/* TODO: Changelog
|
||||
if (project.hasProperty('forgeJenkinsPass'))
|
||||
|
||||
def changelog = rootProject.file('build/changelog.txt')
|
||||
if (changelog.exists())
|
||||
extraTxts += changelog
|
||||
*/
|
||||
|
||||
task downloadCrowdin() {
|
||||
ext {
|
||||
@@ -345,10 +466,10 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
task launcherJson(dependsOn: 'signUniversal') {
|
||||
task launcherJson(dependsOn: ['signUniversalJar', 'signLauncherJar']) {
|
||||
inputs.file universalJar.archivePath
|
||||
ext {
|
||||
output = file('build/libs/version.json')
|
||||
output = file('build/version.json')
|
||||
vanilla = project(':mcp').file('build/mcp/downloadJson/version.json')
|
||||
timestamp = dateToIso8601(new Date())
|
||||
comment = [
|
||||
@@ -371,28 +492,20 @@ 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']
|
||||
game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"]
|
||||
],
|
||||
libraries: [
|
||||
[
|
||||
//Package our launcher jar as the 'main' jar Mojang's launcher loads. It will in turn load Forge's regular jars itself.
|
||||
name: "${project.group}:${project.name}:${project.version}",
|
||||
downloads: [
|
||||
artifact: [
|
||||
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar",
|
||||
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
|
||||
sha1: sha1(universalJar.archivePath),
|
||||
size: universalJar.archivePath.length()
|
||||
sha1: sha1(launcherJar.archivePath),
|
||||
size: launcherJar.archivePath.length()
|
||||
]
|
||||
]
|
||||
]
|
||||
@@ -410,9 +523,9 @@ project(':forge') {
|
||||
|
||||
task installerJson(dependsOn: [launcherJson, genClientBinPatches, applyClientBinPatches, applyServerBinPatches]) {
|
||||
ext {
|
||||
output = file('build/libs/install_profile.json')
|
||||
output = file('build/install_profile.json')
|
||||
INSTALLER_TOOLS = 'net.minecraftforge:installertools:1.0.3'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.0.4'
|
||||
JAR_SPLITTER = 'net.minecraftforge:jarsplitter:1.1.0'
|
||||
}
|
||||
doFirst {
|
||||
ext.BIN_PATCHER = 'net.minecraftforge:binarypatcher:' + genClientBinPatches.resolvedVersion
|
||||
@@ -423,9 +536,22 @@ project(':forge') {
|
||||
inputs.file launcherJson.output
|
||||
outputs.file output
|
||||
doLast {
|
||||
def libs = [:]
|
||||
def libs = [
|
||||
"${project.group}:${project.name}:${project.version}:universal": [
|
||||
name: "${project.group}:${project.name}:${project.version}:universal",
|
||||
downloads: [
|
||||
artifact: [
|
||||
path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}-universal.jar",
|
||||
url: "", //Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier
|
||||
sha1: sha1(universalJar.archivePath),
|
||||
size: universalJar.archivePath.length()
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
def json = [
|
||||
_comment_: launcherJson.comment,
|
||||
spec: 0,
|
||||
profile: project.name,
|
||||
version: launcherJson.id,
|
||||
json: '/version.json',
|
||||
@@ -450,14 +576,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]"
|
||||
@@ -495,13 +613,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.
|
||||
@@ -541,7 +657,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}"
|
||||
@@ -575,71 +691,58 @@ project(':forge') {
|
||||
from { !crowdin.state.skipped ? zipTree(crowdin.archivePath) : null}
|
||||
dependsOn crowdin
|
||||
|
||||
doFirst {
|
||||
MANIFESTS.each{ pkg, values ->
|
||||
if (pkg == '/') {
|
||||
manifest.attributes(values)
|
||||
} else {
|
||||
manifest.attributes(values, pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task launcherJar(type: Jar) {
|
||||
classifier 'launcher'
|
||||
from sourceSets.fmllauncher.output
|
||||
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"
|
||||
|
||||
|
||||
manifest.attributes([
|
||||
'Main-Class': 'net.minecraftforge.server.ServerMain',
|
||||
'Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
'GitCommit': grgit.head().getAbbreviatedId(8),
|
||||
'Git-Branch': grgit.branch.current().getName(),
|
||||
'Class-Path': classpath.toString()
|
||||
] as LinkedHashMap)
|
||||
manifest.attributes([
|
||||
'Specification-Title': 'Forge',
|
||||
'Specification-Vendor': 'Forge Development LLC',
|
||||
'Specification-Version': SPEC_VERSION,
|
||||
'Implementation-Title': 'Forge',
|
||||
'Implementation-Version': project.version.substring(MC_VERSION.length() + 1),
|
||||
'Implementation-Vendor': 'Forge Development LLC'
|
||||
] as LinkedHashMap, 'net/minecraftforge/versions/forge/')
|
||||
manifest.attributes([
|
||||
'Specification-Title': 'Minecraft',
|
||||
'Specification-Vendor': 'Mojang',
|
||||
'Specification-Version': MC_VERSION,
|
||||
'Implementation-Title': 'MCP',
|
||||
'Implementation-Version': MCP_VERSION,
|
||||
'Implementation-Vendor': 'Forge'
|
||||
] as LinkedHashMap, 'net/minecraftforge/versions/mcp/')
|
||||
MANIFESTS.each{ pkg, values ->
|
||||
if (pkg == '/') {
|
||||
manifest.attributes(values += [
|
||||
'Main-Class': 'net.minecraftforge.server.ServerMain',
|
||||
'Class-Path': classpath.toString(),
|
||||
'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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task signUniversal(type: SignJar, dependsOn: universalJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('jarsigner') && universalJar.state.failure == null
|
||||
}
|
||||
|
||||
def jarsigner = [:];
|
||||
if (project.hasProperty('jarsigner'))
|
||||
jarsigner = project.jarsigner;
|
||||
|
||||
alias = 'forge'
|
||||
storePass = jarsigner.storepass
|
||||
keyPass = jarsigner.keypass
|
||||
keyStore = jarsigner.keystore
|
||||
inputFile = universalJar.archivePath
|
||||
outputFile = universalJar.archivePath
|
||||
doFirst {
|
||||
project.logger.lifecycle('Signing: ' + inputFile)
|
||||
}
|
||||
}
|
||||
universalJar.finalizedBy(signUniversal)
|
||||
|
||||
task downloadInstaller(type: DownloadMavenArtifact) {
|
||||
artifact = 'net.minecraftforge:installer:2.0.+:shrunk'
|
||||
changing = true
|
||||
}
|
||||
|
||||
task installerJar(type: Zip, dependsOn: [downloadInstaller, signUniversal, installerJson, launcherJson, genClientBinPatches, genServerBinPatches]) {
|
||||
task installerJar(type: Zip, dependsOn: [downloadInstaller, installerJson, launcherJson, genClientBinPatches, genServerBinPatches, 'signUniversalJar', 'signLauncherJar']) {
|
||||
classifier = 'installer'
|
||||
extension = 'jar' //Needs to be Zip task to not override Manifest, so set extension
|
||||
destinationDir = file('build/libs')
|
||||
from(extraTxts)
|
||||
from(rootProject.file('/src/main/resources/forge_logo.png')) {
|
||||
rename{'big_logo.png'}
|
||||
@@ -653,6 +756,9 @@ project(':forge') {
|
||||
}
|
||||
from(universalJar) {
|
||||
into "/maven/${project.group.replace('.', '/')}/${project.name}/${project.version}/"
|
||||
}
|
||||
from(launcherJar) {
|
||||
into "/maven/${project.group.replace('.', '/')}/${project.name}/${project.version}/"
|
||||
rename { "${project.name}-${project.version}.jar" }
|
||||
}
|
||||
from(installerJson.output)
|
||||
@@ -661,32 +767,31 @@ project(':forge') {
|
||||
duplicatesStrategy = 'exclude'
|
||||
}
|
||||
}
|
||||
task signInstaller(type: SignJar, dependsOn: installerJar) {
|
||||
onlyIf {
|
||||
project.hasProperty('jarsigner') && installerJar.state.failure == null
|
||||
}
|
||||
|
||||
def jarsigner = [:];
|
||||
if (project.hasProperty('jarsigner'))
|
||||
jarsigner = project.jarsigner;
|
||||
|
||||
alias = 'forge'
|
||||
storePass = jarsigner.storepass
|
||||
keyPass = jarsigner.keypass
|
||||
keyStore = jarsigner.keystore
|
||||
inputFile = installerJar.archivePath
|
||||
outputFile = installerJar.archivePath
|
||||
doFirst {
|
||||
project.logger.lifecycle('Signing: ' + inputFile)
|
||||
|
||||
[universalJar, launcherJar, installerJar].each { t ->
|
||||
task "sign${t.name.capitalize()}"(type: SignJar, dependsOn: t) {
|
||||
onlyIf {
|
||||
JAR_SIGNER != null && t.state.failure == null
|
||||
}
|
||||
def jarsigner = JAR_SIGNER == null ? [:] : JAR_SIGNER
|
||||
alias = 'forge'
|
||||
storePass = jarsigner.storepass
|
||||
keyPass = jarsigner.keypass
|
||||
keyStore = jarsigner.keystore
|
||||
inputFile = t.archivePath
|
||||
outputFile = t.archivePath
|
||||
doFirst {
|
||||
project.logger.lifecycle('Signing: ' + inputFile)
|
||||
}
|
||||
}
|
||||
t.finalizedBy(tasks.getByName("sign${t.name.capitalize()}"))
|
||||
}
|
||||
installerJar.finalizedBy(signInstaller)
|
||||
|
||||
task makeMdk(type: Zip) {
|
||||
baseName = project.name
|
||||
classifier = 'mdk'
|
||||
version = project.version
|
||||
destinationDir = file('build/distributions')
|
||||
destinationDir = file('build/libs')
|
||||
|
||||
from rootProject.file('gradlew')
|
||||
from rootProject.file('gradlew.bat')
|
||||
@@ -695,10 +800,18 @@ project(':forge') {
|
||||
into('gradle/')
|
||||
}
|
||||
from(rootProject.file('mdk/')){
|
||||
/* filter(ReplaceTokens, tokens: [
|
||||
VERSION: project.version
|
||||
rootProject.file('mdk/gitignore.txt').eachLine{
|
||||
if (!it.trim().isEmpty() && !it.trim().startsWith('#'))
|
||||
exclude it
|
||||
}
|
||||
filter(ReplaceTokens, tokens: [
|
||||
FORGE_VERSION: project.version,
|
||||
FORGE_GROUP: project.group,
|
||||
FORGE_NAME: project.name,
|
||||
MC_VERSION: MC_VERSION,
|
||||
MAPPING_CHANNEL: MAPPING_CHANNEL,
|
||||
MAPPING_VERSION: MAPPING_VERSION
|
||||
])
|
||||
*/
|
||||
rename 'gitignore\\.txt', '.gitignore'
|
||||
}
|
||||
}
|
||||
@@ -708,6 +821,37 @@ project(':forge') {
|
||||
artifacts.each { key, lib ->
|
||||
addLibrary(lib.name)
|
||||
}
|
||||
addLibrary("${project.group}:${project.name}:${project.version}:launcher")
|
||||
runs {
|
||||
client {
|
||||
main 'net.minecraftforge.userdev.LaunchTesting'
|
||||
|
||||
environment 'target', 'fmluserdevclient'
|
||||
environment 'assetIndex', '{asset_index}'
|
||||
environment 'assetDirectory', '{assets_root}'
|
||||
environment 'nativesDirectory', '{natives}'
|
||||
|
||||
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.LaunchTesting'
|
||||
|
||||
environment 'target', 'fmluserdevserver'
|
||||
|
||||
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)}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
license {
|
||||
@@ -731,16 +875,54 @@ project(':forge') {
|
||||
}
|
||||
}
|
||||
|
||||
task userdevExtras(type:Jar) {
|
||||
dependsOn classes
|
||||
from sourceSets.userdev.output
|
||||
classifier 'userdev-temp'
|
||||
}
|
||||
|
||||
task userdevExtrasReobf(type:TaskReobfuscateJar) {
|
||||
dependsOn userdevExtras, createMcp2Srg
|
||||
input = tasks.userdevExtras.archivePath
|
||||
classpath = project.configurations.compile
|
||||
srg = tasks.createMcp2Srg.output
|
||||
}
|
||||
|
||||
userdevJar {
|
||||
dependsOn userdevExtrasReobf
|
||||
from (zipTree(tasks.userdevExtrasReobf.output)) {
|
||||
into '/inject/'
|
||||
}
|
||||
from (sourceSets.userdev.output.resourcesDir) {
|
||||
into '/inject/'
|
||||
}
|
||||
}
|
||||
|
||||
extractRangeMap {
|
||||
addDependencies jar.archivePath
|
||||
addSources sourceSets.userdev.java.srcDirs
|
||||
}
|
||||
applyRangeMap {
|
||||
setSources sourceSets.userdev.java.srcDirs
|
||||
}
|
||||
|
||||
tasks.eclipse.dependsOn('genEclipseRuns')
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact universalJar
|
||||
//TODO: changelog
|
||||
if (changelog.exists()) {
|
||||
artifact(changelog) {
|
||||
classifier = 'changelog'
|
||||
}
|
||||
}
|
||||
artifact installerJar
|
||||
//TODO: installer-win
|
||||
artifact makeMdk
|
||||
artifact userdevJar
|
||||
artifact sourcesJar
|
||||
artifact launcherJar
|
||||
|
||||
pom {
|
||||
name = 'forge'
|
||||
@@ -775,7 +957,7 @@ project(':forge') {
|
||||
username project.properties.forgeMavenUser
|
||||
password project.properties.forgeMavenPassword
|
||||
}
|
||||
url 'http://files.minecraftforge.net/maven/manage/upload'
|
||||
url 'https://files.minecraftforge.net/maven/manage/upload'
|
||||
} else {
|
||||
url 'file://' + rootProject.file('repo').getAbsolutePath()
|
||||
}
|
||||
|
||||
+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
|
||||
=========================
|
||||
|
||||
+95
-56
@@ -1,92 +1,131 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url = 'http://files.minecraftforge.net/maven' }
|
||||
maven { url = 'https://files.minecraftforge.net/maven' }
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
// This is only here while i'm activly developing FG, Remind me to remove when we publically release
|
||||
configurations {
|
||||
classpath.resolutionStrategy {
|
||||
cacheDynamicVersionsFor 10, 'seconds'
|
||||
cacheChangingModulesFor 0, 'seconds'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
|
||||
repositories {
|
||||
maven { url ='file://' + file('../repo').absolutePath } //Used by Forge development testing only, you can delete this.
|
||||
}
|
||||
// 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
|
||||
archivesBaseName = 'modid'
|
||||
|
||||
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
compileJava {
|
||||
sourceCompatibility = targetCompatibility = '1.8'
|
||||
}
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
|
||||
|
||||
minecraft {
|
||||
// the mappings can be changed at any time, and must be in the following format.
|
||||
// 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.
|
||||
mappings channel: 'snapshot', version: '20180921-1.13'
|
||||
// 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('test_at.cfg')
|
||||
// accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
|
||||
|
||||
// Default run configurations.
|
||||
// These can be tweaked, removed, or duplicated as needed.
|
||||
runs {
|
||||
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 {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||
minecraft 'net.minecraftforge:forge:1.13-15.24.0.0-1.13-pre'
|
||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
||||
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
|
||||
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
//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'
|
||||
|
||||
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
|
||||
// except that these dependencies get remapped to your current MCP mappings
|
||||
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
// These dependencies get remapped to your current MCP mappings
|
||||
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
|
||||
// for more info...
|
||||
// For more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
}
|
||||
|
||||
processResources {
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property 'version', project.version
|
||||
inputs.property 'mcversion', '1.13'
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion': '1.13'
|
||||
}
|
||||
|
||||
// copy everything else except the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
// 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": "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>
|
||||
@@ -20,3 +20,6 @@ build
|
||||
# other
|
||||
eclipse
|
||||
run
|
||||
|
||||
# Files from Forge MDK
|
||||
forge*changelog.txt
|
||||
@@ -1,3 +1,4 @@
|
||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
@@ -5,14 +5,19 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLModLoadingContext;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// The value here should match an entry in the META-INF/mods.toml file
|
||||
@Mod("examplemod")
|
||||
public class ExampleMod
|
||||
@@ -21,36 +26,59 @@ public class ExampleMod
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
public ExampleMod() {
|
||||
// Register the preInit method for modloading
|
||||
FMLModLoadingContext.get().getModEventBus().addListener(this::preInit);
|
||||
// Register the init method for modloading
|
||||
FMLModLoadingContext.get().getModEventBus().addListener(this::init);
|
||||
// Register the setup method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
|
||||
// Register the enqueueIMC method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
|
||||
// Register the processIMC method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
|
||||
// Register the doClientStuff method for modloading
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
|
||||
|
||||
// Register ourselves for server, registry and other game events we are interested in
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
private void preInit(final FMLPreInitializationEvent event)
|
||||
private void setup(final FMLCommonSetupEvent event)
|
||||
{
|
||||
// some preinit code
|
||||
LOGGER.info("HELLO FROM PREINIT");
|
||||
}
|
||||
|
||||
private void init(final FMLInitializationEvent event)
|
||||
{
|
||||
// some example code
|
||||
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
// register a new block here
|
||||
LOGGER.info("HELLO from Register Block");
|
||||
private void doClientStuff(final FMLClientSetupEvent event) {
|
||||
// do something that can only be done on the client
|
||||
LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
|
||||
}
|
||||
|
||||
private void enqueueIMC(final InterModEnqueueEvent event)
|
||||
{
|
||||
// some example code to dispatch IMC to another mod
|
||||
InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
|
||||
}
|
||||
|
||||
private void processIMC(final InterModProcessEvent event)
|
||||
{
|
||||
// some example code to receive and process InterModComms from other mods
|
||||
LOGGER.info("Got IMC {}", event.getIMCStream().
|
||||
map(m->m.getMessageSupplier().get()).
|
||||
collect(Collectors.toList()));
|
||||
}
|
||||
// You can use SubscribeEvent and let the Event Bus discover methods to call
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event) {
|
||||
// do something when the server starts
|
||||
LOGGER.info("HELLO from server starting");
|
||||
}
|
||||
|
||||
// You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
|
||||
// Event bus for receiving Registry Events)
|
||||
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
|
||||
public static class RegistryEvents {
|
||||
@SubscribeEvent
|
||||
public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
|
||||
// register a new block here
|
||||
LOGGER.info("HELLO from Register Block");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,20 @@
|
||||
# Find more information on toml format here: https://github.com/toml-lang/toml
|
||||
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
|
||||
modLoader="javafml" #mandatory
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the minecraft version (without the 1.)
|
||||
loaderVersion="[13,)" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
updateJSONURL="http://myurl.me/" #optional
|
||||
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
|
||||
loaderVersion="[25,)" #mandatory (24 is current forge version)
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="http://my.issue.tracker/" #optional
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
modId="examplemod" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
version="${file.jarVersion}" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="Example Mod" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification <here>
|
||||
updateJSONURL="http://myurl.me/" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
displayURL="http://example.com/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
@@ -19,14 +27,6 @@ logoFile="examplemod.png" #optional
|
||||
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
|
||||
modId="examplemod" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
version="1.0" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="Example Mod" #mandatory
|
||||
# The description text for the mod (multi line!) (#mandatory)
|
||||
description='''
|
||||
This is a long form description of the mod. You can write whatever you want here
|
||||
@@ -35,7 +35,6 @@ Have some lorem ipsum.
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
'''
|
||||
|
||||
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
|
||||
[[dependencies.examplemod]] #optional
|
||||
# the modid of the dependency
|
||||
@@ -43,7 +42,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magn
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[14.23.2.0,)" #mandatory
|
||||
versionRange="[25,)" #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
|
||||
@@ -52,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.13.2]"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
@@ -1 +0,0 @@
|
||||
public net.minecraft.block.Block field_196273_d # LOGGER
|
||||
@@ -7,7 +7,7 @@ updateJSONURL="http://myurl.me/"
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="http://my.issue.tracker/"
|
||||
# Extra mod loader property
|
||||
randomScalaProperty=fishy
|
||||
randomScalaProperty="fishy"
|
||||
# Arbitrary key-value property pairs available to mods
|
||||
[properties]
|
||||
key="value"
|
||||
@@ -25,13 +25,16 @@ key="value"
|
||||
This is my mod, there may be
|
||||
others, but this one is mine
|
||||
'''
|
||||
# Override the default resourcelocation namespace with this instead
|
||||
# Currently not implemented
|
||||
namespace="invsorter"
|
||||
# A random extra property for a mod loader
|
||||
randomExtraProperty=somevalue
|
||||
randomExtraProperty="somevalue"
|
||||
# Arbitrary key-value pairs
|
||||
[inventorysorter.properties]
|
||||
[modproperties.inventorysorter]
|
||||
key="value"
|
||||
# A list of dependencies
|
||||
[[inventorysorter.dependencies]]
|
||||
[[dependencies.inventorysorter]]
|
||||
# the modid of the dependency
|
||||
modid="forge"
|
||||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
@@ -39,22 +42,23 @@ key="value"
|
||||
# The version range of the dependency
|
||||
versionRange="[14.23.2.0,)"
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering=NONE
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
side=BOTH
|
||||
side="BOTH"
|
||||
# Here's another dependency
|
||||
[[inventorysorter.dependencies]]
|
||||
[[dependencies.inventorysorter]]
|
||||
modid="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.12.2]"
|
||||
ordering=NONE
|
||||
side=BOTH
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
# Here's another mod in this jar
|
||||
[[mods]]
|
||||
# Note that other mod types may want to add additional key-value pairs in here
|
||||
modId="inventorysortertoo"
|
||||
# ${jarVersion} will read the Implementation-Version of the jar file
|
||||
version="${jarVersion}"
|
||||
# ${file.jarVersion} will read the Implementation-Version of the jar file
|
||||
version="${file.jarVersion}"
|
||||
displayName="Inventory Sorter as well"
|
||||
description='''
|
||||
This is also my mod, there may be
|
||||
|
||||
@@ -0,0 +1,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));
|
||||
@@ -909,6 +913,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) {
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/advancements/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/advancements/PlayerAdvancements.java
|
||||
@@ -186,6 +186,8 @@
|
||||
}
|
||||
|
||||
public boolean func_192750_a(Advancement p_192750_1_, String p_192750_2_) {
|
||||
+ // Forge: don't grant advancements for fake players
|
||||
+ if (this.field_192762_j instanceof net.minecraftforge.common.util.FakePlayer) return false;
|
||||
boolean flag = false;
|
||||
AdvancementProgress advancementprogress = this.func_192747_a(p_192750_1_);
|
||||
boolean flag1 = advancementprogress.func_192105_a();
|
||||
@@ -198,6 +200,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 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_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
+++ b/net/minecraft/advancements/criterion/ItemPredicate.java
|
||||
@@ -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<>();
|
||||
+ private static final Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> unmod_predicates = java.util.Collections.unmodifiableMap(custom_predicates);
|
||||
public static final ItemPredicate field_192495_a = new ItemPredicate();
|
||||
@Nullable
|
||||
private final Tag<Item> field_200018_b;
|
||||
@@ -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");
|
||||
+ if (jsonobject.has("type")) {
|
||||
+ final ResourceLocation rl = new ResourceLocation(JSONUtils.func_151200_h(jsonobject, "type"));
|
||||
+ if (custom_predicates.containsKey(rl)) return custom_predicates.get(rl).apply(jsonobject);
|
||||
+ else throw new JsonSyntaxException("There is no ItemPredicate of type "+rl);
|
||||
+ }
|
||||
MinMaxBounds.IntBound minmaxbounds$intbound = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("count"));
|
||||
MinMaxBounds.IntBound minmaxbounds$intbound1 = MinMaxBounds.IntBound.func_211344_a(jsonobject.get("durability"));
|
||||
if (jsonobject.has("data")) {
|
||||
@@ -181,6 +188,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ public static void register(ResourceLocation name, java.util.function.Function<JsonObject, ItemPredicate> deserializer) {
|
||||
+ custom_predicates.put(name, deserializer);
|
||||
+ }
|
||||
+
|
||||
+ public static Map<ResourceLocation, java.util.function.Function<JsonObject, ItemPredicate>> getPredicates() {
|
||||
+ return unmod_predicates;
|
||||
+ }
|
||||
+
|
||||
public static class Builder {
|
||||
private final List<EnchantmentPredicate> field_200312_a = Lists.newArrayList();
|
||||
@Nullable
|
||||
@@ -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;
|
||||
@@ -1,15 +1,60 @@
|
||||
--- a/net/minecraft/block/Block.java
|
||||
+++ b/net/minecraft/block/Block.java
|
||||
@@ -74,7 +74,7 @@
|
||||
@@ -74,9 +74,10 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
-public class Block implements IItemProvider {
|
||||
+public class Block extends net.minecraftforge.registries.ForgeRegistryEntry<Block> implements IItemProvider, net.minecraftforge.common.extensions.IForgeBlock {
|
||||
protected static final Logger field_196273_d = LogManager.getLogger();
|
||||
private static final ResourceLocation field_176230_a = new ResourceLocation("air");
|
||||
public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> field_149771_c = new RegistryNamespacedDefaultedByKey<ResourceLocation, Block>(field_176230_a);
|
||||
@@ -502,8 +502,8 @@
|
||||
- public static final ObjectIntIdentityMap<BlockState> field_176229_d = new ObjectIntIdentityMap<>();
|
||||
+ @Deprecated //Forge: Do not use, use GameRegistry
|
||||
+ 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_) {
|
||||
@@ -290,7 +291,7 @@
|
||||
|
||||
@Deprecated
|
||||
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
|
||||
@@ -302,8 +303,9 @@
|
||||
return this.field_149789_z;
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: New State sensitive version.
|
||||
public boolean func_149716_u() {
|
||||
- return this instanceof ITileEntityProvider;
|
||||
+ return hasTileEntity(func_176223_P());
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -314,7 +316,7 @@
|
||||
@Deprecated
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
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)
|
||||
@@ -459,10 +461,9 @@
|
||||
|
||||
@Deprecated
|
||||
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
|
||||
@@ -471,8 +472,8 @@
|
||||
if (f == -1.0F) {
|
||||
return 0.0F;
|
||||
} else {
|
||||
@@ -20,71 +65,130 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,6 +625,7 @@
|
||||
@@ -552,7 +553,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
|
||||
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;
|
||||
@@ -564,7 +565,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_82766_b("doTileDrops")) {
|
||||
+ if (!p_180637_1_.field_72995_K && p_180637_1_.func_82736_K().func_82766_b("doTileDrops") && !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;
|
||||
@@ -574,6 +575,7 @@
|
||||
|
||||
}
|
||||
|
||||
+ @Deprecated //Use state sensitive version
|
||||
protected boolean func_149700_E() {
|
||||
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
|
||||
+ @Deprecated //Forge: State sensitive version
|
||||
public float func_149638_a() {
|
||||
return this.field_149781_w;
|
||||
}
|
||||
@@ -755,6 +756,7 @@
|
||||
@@ -676,6 +678,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
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, BlockState p_185473_3_) {
|
||||
return new ItemStack(this);
|
||||
@@ -690,6 +693,7 @@
|
||||
return Fluids.field_204541_a.func_207188_f();
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use more sensitive version
|
||||
public float func_208618_m() {
|
||||
return this.field_149765_K;
|
||||
}
|
||||
@@ -710,6 +714,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;
|
||||
}
|
||||
@@ -754,6 +759,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;
|
||||
}
|
||||
@@ -1604,4 +1606,56 @@
|
||||
return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
|
||||
}
|
||||
@@ -779,13 +785,74 @@
|
||||
}
|
||||
|
||||
public static boolean func_196252_e(Block p_196252_0_) {
|
||||
- return p_196252_0_ == Blocks.field_150348_b || p_196252_0_ == Blocks.field_196650_c || p_196252_0_ == Blocks.field_196654_e || p_196252_0_ == Blocks.field_196656_g;
|
||||
+ return net.minecraftforge.common.Tags.Blocks.STONE.func_199685_a_(p_196252_0_);
|
||||
}
|
||||
|
||||
public static boolean func_196245_f(Block p_196245_0_) {
|
||||
- return p_196245_0_ == Blocks.field_150346_d || p_196245_0_ == Blocks.field_196660_k || p_196245_0_ == Blocks.field_196661_l;
|
||||
+ return net.minecraftforge.common.Tags.Blocks.DIRT.func_199685_a_(p_196245_0_);
|
||||
}
|
||||
|
||||
+ /* ======================================== FORGE START =====================================*/
|
||||
+ private ThreadLocal<IBlockState> silkCheck = new ThreadLocal<>();
|
||||
+ protected Random RANDOM = new Random();
|
||||
+ 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();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @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();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onBlockExploded(IBlockState state, World world, BlockPos pos, Explosion explosion) {
|
||||
+ world.func_175698_g(pos);
|
||||
+ func_180652_a(world, pos, explosion);
|
||||
+ }
|
||||
+
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.ToolType getHarvestTool(IBlockState state) {
|
||||
+ 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(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;
|
||||
+
|
||||
+ if (plant.func_177230_c() == Blocks.field_196608_cF && this == Blocks.field_196608_cF)
|
||||
+ return true;
|
||||
+
|
||||
+ 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 GlazedTerracottaBlock;
|
||||
+ case Nether: return this.getBlock() == Blocks.field_150425_aM;
|
||||
+ 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 Beach:
|
||||
+ boolean isBeach = this.getBlock() == Blocks.field_196658_i || Block.func_196245_f(this) || this.getBlock() == Blocks.field_150354_m;
|
||||
+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h ||
|
||||
+ world.func_180495_p(pos.func_177976_e()).func_185904_a() == Material.field_151586_h ||
|
||||
+ world.func_180495_p(pos.func_177978_c()).func_185904_a() == Material.field_151586_h ||
|
||||
+ world.func_180495_p(pos.func_177968_d()).func_185904_a() == Material.field_151586_h);
|
||||
+ return isBeach && hasWater;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ static {
|
||||
+ net.minecraftforge.common.ForgeHooks.setBlockToolSetter((block, tool, level) -> {
|
||||
+ block.harvestTool = tool;
|
||||
@@ -92,4 +196,7 @@
|
||||
+ });
|
||||
+ }
|
||||
+ /* ========================================= FORGE END ======================================*/
|
||||
}
|
||||
+
|
||||
public static enum OffsetType {
|
||||
NONE,
|
||||
XZ,
|
||||
@@ -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;
|
||||
@@ -107,10 +107,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_);
|
||||
}
|
||||
@@ -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;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
--- 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 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);
|
||||
@@ -30,6 +30,7 @@
|
||||
}
|
||||
|
||||
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 {
|
||||
@@ -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());
|
||||
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);
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
+ 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(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.PlantType getPlantType(IBlockReader world, BlockPos pos) {
|
||||
+ return net.minecraftforge.common.PlantType.Desert;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ 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,30 @@
|
||||
--- a/net/minecraft/block/CropsBlock.java
|
||||
+++ b/net/minecraft/block/CropsBlock.java
|
||||
@@ -58,12 +58,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_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,9 +94,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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- 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);
|
||||
- if (p_180655_2_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150342_X) {
|
||||
+ if (p_180655_2_.func_180495_p(blockpos).getEnchantPowerBonus(p_180655_2_, p_180655_3_) > 0) {
|
||||
if (!p_180655_2_.func_175623_d(p_180655_3_.func_177982_a(i / 2, 0, j / 2))) {
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,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());
|
||||
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/block/FarmlandBlock.java
|
||||
+++ b/net/minecraft/block/FarmlandBlock.java
|
||||
@@ -72,7 +72,7 @@
|
||||
}
|
||||
|
||||
public void func_180658_a(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) {
|
||||
- if (!p_180658_1_.field_72995_K && p_180658_1_.field_73012_v.nextFloat() < p_180658_4_ - 0.5F && p_180658_3_ instanceof LivingEntity && (p_180658_3_ instanceof PlayerEntity || p_180658_1_.func_82736_K().func_82766_b("mobGriefing")) && 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_);
|
||||
}
|
||||
|
||||
@@ -83,9 +83,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 CropsBlock || block instanceof StemBlock || block instanceof AttachedStemBlock;
|
||||
+ private boolean func_176529_d(IBlockReader p_176529_0_, BlockPos p_176529_1_) {
|
||||
+ 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(IWorldReader p_176530_0_, BlockPos p_176530_1_) {
|
||||
@@ -95,7 +95,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_) {
|
||||
@@ -0,0 +1,181 @@
|
||||
--- a/net/minecraft/block/FireBlock.java
|
||||
+++ b/net/minecraft/block/FireBlock.java
|
||||
@@ -63,13 +63,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();
|
||||
|
||||
for(Direction direction : Direction.values()) {
|
||||
BooleanProperty booleanproperty = field_196449_B.get(direction);
|
||||
if (booleanproperty != null) {
|
||||
- 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())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,12 +90,14 @@
|
||||
|
||||
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_82766_b("doFireTick")) {
|
||||
+ 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_217377_a(p_196267_3_, false);
|
||||
}
|
||||
|
||||
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;
|
||||
+ 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_217377_a(p_196267_3_, false);
|
||||
@@ -117,7 +119,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(), Direction.UP)) {
|
||||
p_196267_2_.func_217377_a(p_196267_3_, false);
|
||||
return;
|
||||
}
|
||||
@@ -125,12 +127,12 @@
|
||||
|
||||
boolean flag1 = p_196267_2_.func_180502_D(p_196267_3_);
|
||||
int k = flag1 ? -50 : 0;
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177976_e(), 300 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177977_b(), 250 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177984_a(), 250 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177978_c(), 300 + k, p_196267_4_, i);
|
||||
- this.func_176536_a(p_196267_2_, p_196267_3_.func_177968_d(), 300 + k, p_196267_4_, i);
|
||||
+ this.tryCatchFire(p_196267_2_, p_196267_3_.func_177974_f(), 300 + k, p_196267_4_, i, 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) {
|
||||
@@ -168,16 +170,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());
|
||||
}
|
||||
|
||||
- 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_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_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) {
|
||||
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_)) {
|
||||
@@ -198,7 +202,7 @@
|
||||
|
||||
private boolean func_196447_a(IBlockReader p_196447_1_, BlockPos p_196447_2_) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -214,13 +218,14 @@
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
+ @Deprecated //Forge: Use canCatchFire with more context
|
||||
public boolean func_196446_i(BlockState p_196446_1_) {
|
||||
return this.func_220275_r(p_196446_1_) > 0;
|
||||
}
|
||||
@@ -245,8 +250,8 @@
|
||||
|
||||
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 (!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();
|
||||
@@ -255,7 +260,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(), 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();
|
||||
@@ -264,7 +269,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(), 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();
|
||||
@@ -273,7 +278,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(), 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();
|
||||
@@ -282,7 +287,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(), 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;
|
||||
@@ -310,10 +315,23 @@
|
||||
}
|
||||
|
||||
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_) {
|
||||
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
|
||||
this.field_149849_a.put(p_180686_1_, p_180686_2_);
|
||||
this.field_149848_b.put(p_180686_1_, p_180686_3_);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Side sensitive version that calls the block function.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param pos Block position
|
||||
+ * @param face The side the fire is coming from
|
||||
+ * @return True if the face can catch fire.
|
||||
+ */
|
||||
+ public boolean canCatchFire(IBlockReader world, BlockPos pos, Direction face) {
|
||||
+ return world.func_180495_p(pos).isFlammable(world, pos, face);
|
||||
+ }
|
||||
+
|
||||
public static void func_149843_e() {
|
||||
FireBlock fireblock = (FireBlock)Blocks.field_150480_ab;
|
||||
fireblock.func_180686_a(Blocks.field_196662_n, 5, 20);
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/FlowerPotBlock.java
|
||||
+++ b/net/minecraft/block/FlowerPotBlock.java
|
||||
@@ -21,7 +21,7 @@
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
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);
|
||||
private final Block field_196452_c;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/block/ITileEntityProvider.java
|
||||
+++ b/net/minecraft/block/ITileEntityProvider.java
|
||||
@@ -4,6 +4,7 @@
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
+@Deprecated //Forge: Do not use, use 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
|
||||
@@ -68,7 +68,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_);
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/block/NoteBlock.java
|
||||
+++ b/net/minecraft/block/NoteBlock.java
|
||||
@@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
private void func_196482_a(World p_196482_1_, BlockPos p_196482_2_) {
|
||||
- if (p_196482_1_.func_180495_p(p_196482_2_.func_177984_a()).func_196958_f()) {
|
||||
+ if (p_196482_1_.func_175623_d(p_196482_2_.func_177984_a())) {
|
||||
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
if (p_220051_2_.field_72995_K) {
|
||||
return true;
|
||||
} else {
|
||||
- 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_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(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((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;
|
||||
@@ -0,0 +1,57 @@
|
||||
--- 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 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 = (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.canMakeSlopes = this.field_196922_c.canMakeSlopes(field_196923_d, p_i47755_1_, p_i47755_2_);
|
||||
this.func_208509_a(railshape);
|
||||
}
|
||||
|
||||
@@ -178,7 +180,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.NORTH_SOUTH) {
|
||||
+ if (railshape == RailShape.NORTH_SOUTH && canMakeSlopes) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_NORTH;
|
||||
}
|
||||
@@ -188,7 +190,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.EAST_WEST) {
|
||||
+ if (railshape == RailShape.EAST_WEST && canMakeSlopes) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_EAST;
|
||||
}
|
||||
@@ -298,7 +300,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.NORTH_SOUTH) {
|
||||
+ if (railshape == RailShape.NORTH_SOUTH && canMakeSlopes) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_NORTH;
|
||||
}
|
||||
@@ -308,7 +310,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (railshape == RailShape.EAST_WEST) {
|
||||
+ if (railshape == RailShape.EAST_WEST && canMakeSlopes) {
|
||||
if (AbstractRailBlock.func_208488_a(this.field_196920_a, blockpos3.func_177984_a())) {
|
||||
railshape = RailShape.ASCENDING_EAST;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
--- a/net/minecraft/block/RedstoneDiodeBlock.java
|
||||
+++ b/net/minecraft/block/RedstoneDiodeBlock.java
|
||||
@@ -65,7 +65,7 @@
|
||||
if (p_220069_1_.func_196955_c(p_220069_2_, p_220069_3_)) {
|
||||
this.func_176398_g(p_220069_2_, p_220069_3_, p_220069_1_);
|
||||
} else {
|
||||
- TileEntity tileentity = this.func_149716_u() ? p_220069_2_.func_175625_s(p_220069_3_) : null;
|
||||
+ TileEntity tileentity = p_220069_1_.hasTileEntity() ? p_220069_2_.func_175625_s(p_220069_3_) : null;
|
||||
func_220059_a(p_220069_1_, p_220069_2_, p_220069_3_, tileentity);
|
||||
p_220069_2_.func_217377_a(p_220069_3_, false);
|
||||
|
||||
@@ -164,6 +164,8 @@
|
||||
protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, BlockState p_176400_3_) {
|
||||
Direction direction = p_176400_3_.func_177229_b(field_185512_D);
|
||||
BlockPos blockpos = p_176400_2_.func_177972_a(direction.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(direction.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, direction);
|
||||
}
|
||||
@@ -171,7 +173,6 @@
|
||||
protected boolean func_185545_A(BlockState p_185545_1_) {
|
||||
return p_185545_1_.func_185897_m();
|
||||
}
|
||||
-
|
||||
protected int func_176408_a(IBlockReader p_176408_1_, BlockPos p_176408_2_, BlockState p_176408_3_) {
|
||||
return 15;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/block/RedstoneOreBlock.java
|
||||
+++ b/net/minecraft/block/RedstoneOreBlock.java
|
||||
@@ -61,11 +61,11 @@
|
||||
|
||||
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 = 1 + p_220062_2_.field_73012_v.nextInt(5);
|
||||
- this.func_180637_b(p_220062_2_, p_220062_3_, i);
|
||||
- }
|
||||
+ }
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune, int silktouch) {
|
||||
+ return silktouch == 0 ? 1 + RANDOM.nextInt(5) : 0;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@@ -0,0 +1,60 @@
|
||||
--- a/net/minecraft/block/RedstoneWireBlock.java
|
||||
+++ b/net/minecraft/block/RedstoneWireBlock.java
|
||||
@@ -124,7 +124,7 @@
|
||||
BlockState blockstate1 = p_208074_1_.func_180495_p(blockpos1);
|
||||
if (!blockstate1.func_215686_e(p_208074_1_, blockpos1)) {
|
||||
boolean flag = Block.func_220056_d(blockstate, p_208074_1_, blockpos, Direction.UP) || blockstate.func_177230_c() == Blocks.field_150438_bZ;
|
||||
- if (flag && func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177984_a()))) {
|
||||
+ if (flag && canConnectTo(p_208074_1_.func_180495_p(blockpos.func_177984_a()), p_208074_1_, blockpos.func_177984_a(), null)) {
|
||||
if (func_208062_a(blockstate.func_196952_d(p_208074_1_, blockpos))) {
|
||||
return RedstoneSide.UP;
|
||||
}
|
||||
@@ -133,7 +133,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- return !func_176343_a(blockstate, p_208074_3_) && (blockstate.func_215686_e(p_208074_1_, blockpos) || !func_176346_d(p_208074_1_.func_180495_p(blockpos.func_177977_b()))) ? RedstoneSide.NONE : RedstoneSide.SIDE;
|
||||
+ return !canConnectTo(blockstate, p_208074_1_, blockpos, p_208074_3_) && (blockstate.func_215686_e(p_208074_1_, blockpos) || !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_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) {
|
||||
@@ -318,26 +318,18 @@
|
||||
boolean flag = blockstate.func_215686_e(p_176339_1_, blockpos);
|
||||
BlockPos blockpos1 = p_176339_2_.func_177984_a();
|
||||
boolean flag1 = p_176339_1_.func_180495_p(blockpos1).func_215686_e(p_176339_1_, blockpos1);
|
||||
- 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(blockstate, p_176339_3_)) {
|
||||
+ } else if (canConnectTo(blockstate, p_176339_1_, blockpos, p_176339_3_)) {
|
||||
return true;
|
||||
} else if (blockstate.func_177230_c() == Blocks.field_196633_cV && blockstate.func_177229_b(RedstoneDiodeBlock.field_196348_c) && blockstate.func_177229_b(RedstoneDiodeBlock.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(BlockState p_176346_0_) {
|
||||
- return func_176343_a(p_176346_0_, (Direction)null);
|
||||
- }
|
||||
-
|
||||
- protected static boolean func_176343_a(BlockState p_176343_0_, @Nullable Direction p_176343_1_) {
|
||||
+ protected static boolean canConnectTo(BlockState p_176343_0_, IBlockReader world, BlockPos pos, @Nullable Direction p_176343_1_) {
|
||||
Block block = p_176343_0_.func_177230_c();
|
||||
if (block == Blocks.field_150488_af) {
|
||||
return true;
|
||||
@@ -347,7 +339,7 @@
|
||||
} else if (Blocks.field_190976_dk == p_176343_0_.func_177230_c()) {
|
||||
return p_176343_1_ == p_176343_0_.func_177229_b(ObserverBlock.field_176387_N);
|
||||
} else {
|
||||
- return p_176343_0_.func_185897_m() && p_176343_1_ != null;
|
||||
+ return p_176343_0_.canConnectRedstone(world, pos, p_176343_1_) && p_176343_1_ != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/block/SaplingBlock.java
|
||||
+++ b/net/minecraft/block/SaplingBlock.java
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
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_201696_r(p_196267_3_.func_177984_a()) >= 9 && p_196267_4_.nextInt(7) == 0) {
|
||||
this.func_176478_d(p_196267_2_, p_196267_3_, p_196267_1_, p_196267_4_);
|
||||
}
|
||||
@@ -39,6 +40,7 @@
|
||||
if (p_176478_3_.func_177229_b(field_176479_b) == 0) {
|
||||
p_176478_1_.func_180501_a(p_176478_2_, p_176478_3_.func_177231_a(field_176479_b), 4);
|
||||
} else {
|
||||
+ if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(p_176478_1_, p_176478_4_, p_176478_2_)) return;
|
||||
this.field_196387_c.func_196935_a(p_176478_1_, p_176478_2_, p_176478_3_, p_176478_4_);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/SeaGrassBlock.java
|
||||
+++ b/net/minecraft/block/SeaGrassBlock.java
|
||||
@@ -16,7 +16,7 @@
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class SeaGrassBlock extends BushBlock implements IGrowable, ILiquidContainer {
|
||||
+public class SeaGrassBlock extends BushBlock implements IGrowable, ILiquidContainer, net.minecraftforge.common.IShearable {
|
||||
protected static final VoxelShape field_207798_a = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 12.0D, 14.0D);
|
||||
|
||||
protected SeaGrassBlock(Block.Properties p_i48780_1_) {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/ShearableDoublePlantBlock.java
|
||||
+++ b/net/minecraft/block/ShearableDoublePlantBlock.java
|
||||
@@ -4,7 +4,7 @@
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.properties.DoubleBlockHalf;
|
||||
|
||||
-public class ShearableDoublePlantBlock extends DoublePlantBlock {
|
||||
+public class ShearableDoublePlantBlock extends DoublePlantBlock implements net.minecraftforge.common.IShearable {
|
||||
public static final EnumProperty<DoubleBlockHalf> field_208063_b = DoublePlantBlock.field_176492_b;
|
||||
|
||||
public ShearableDoublePlantBlock(Block.Properties p_i49975_1_) {
|
||||
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/block/SoundType.java
|
||||
+++ b/net/minecraft/block/SoundType.java
|
||||
@@ -54,7 +54,6 @@
|
||||
return this.field_185861_n;
|
||||
}
|
||||
|
||||
- @OnlyIn(Dist.CLIENT)
|
||||
public SoundEvent func_185845_c() {
|
||||
return this.field_185862_o;
|
||||
}
|
||||
@@ -67,7 +66,6 @@
|
||||
return this.field_185864_q;
|
||||
}
|
||||
|
||||
- @OnlyIn(Dist.CLIENT)
|
||||
public SoundEvent func_185846_f() {
|
||||
return this.field_185865_r;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
--- a/net/minecraft/block/SpawnerBlock.java
|
||||
+++ b/net/minecraft/block/SpawnerBlock.java
|
||||
@@ -21,10 +21,13 @@
|
||||
|
||||
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_);
|
||||
- int i = 15 + p_220062_2_.field_73012_v.nextInt(15) + p_220062_2_.field_73012_v.nextInt(15);
|
||||
- this.func_180637_b(p_220062_2_, p_220062_3_, i);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public int getExpDrop(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, int fortune, int silktouch) {
|
||||
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
|
||||
+ }
|
||||
+
|
||||
public BlockRenderType func_149645_b(BlockState p_149645_1_) {
|
||||
return BlockRenderType.MODEL;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/block/SpreadableSnowyDirtBlock.java
|
||||
+++ b/net/minecraft/block/SpreadableSnowyDirtBlock.java
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
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_72995_K) {
|
||||
+ if (!p_196267_2_.isAreaLoaded(p_196267_3_, 3)) return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
|
||||
if (!func_220257_b(p_196267_1_, p_196267_2_, p_196267_3_)) {
|
||||
p_196267_2_.func_175656_a(p_196267_3_, Blocks.field_150346_d.func_176223_P());
|
||||
} else if (p_196267_2_.func_201696_r(p_196267_3_.func_177984_a()) >= 4) {
|
||||
@@ -0,0 +1,32 @@
|
||||
--- a/net/minecraft/block/StemBlock.java
|
||||
+++ b/net/minecraft/block/StemBlock.java
|
||||
@@ -39,22 +39,24 @@
|
||||
|
||||
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) {
|
||||
float f = CropsBlock.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, Integer.valueOf(i + 1)), 2);
|
||||
} else {
|
||||
Direction direction = Direction.Plane.HORIZONTAL.func_179518_a(p_196267_4_);
|
||||
BlockPos blockpos = p_196267_3_.func_177972_a(direction);
|
||||
- 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)) {
|
||||
+ BlockState 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(), Direction.UP, this) || 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)) {
|
||||
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(HorizontalBlock.field_185512_D, direction));
|
||||
}
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
--- a/net/minecraft/block/SugarCaneBlock.java
|
||||
+++ b/net/minecraft/block/SugarCaneBlock.java
|
||||
@@ -16,7 +16,7 @@
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class SugarCaneBlock extends Block {
|
||||
+public class SugarCaneBlock extends Block implements net.minecraftforge.common.IPlantable {
|
||||
public static final IntegerProperty field_176355_a = BlockStateProperties.field_208171_X;
|
||||
protected static final VoxelShape field_196503_b = Block.func_208617_a(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D);
|
||||
|
||||
@@ -40,12 +40,15 @@
|
||||
|
||||
if (i < 3) {
|
||||
int j = p_196267_1_.func_177229_b(field_176355_a);
|
||||
+ if (net.minecraftforge.common.ForgeHooks.onCropsGrowPre(p_196267_2_, p_196267_3_, p_196267_1_, true)) {
|
||||
if (j == 15) {
|
||||
p_196267_2_.func_175656_a(p_196267_3_.func_177984_a(), this.func_176223_P());
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(0)), 4);
|
||||
} else {
|
||||
p_196267_2_.func_180501_a(p_196267_3_, p_196267_1_.func_206870_a(field_176355_a, Integer.valueOf(j + 1)), 4);
|
||||
}
|
||||
+ net.minecraftforge.common.ForgeHooks.onCropsGrowPost(p_196267_2_, p_196267_3_, p_196267_1_);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +63,8 @@
|
||||
}
|
||||
|
||||
public boolean func_196260_a(BlockState p_196260_1_, IWorldReader p_196260_2_, BlockPos p_196260_3_) {
|
||||
+ BlockState soil = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b());
|
||||
+ if (soil.canSustainPlant(p_196260_2_, p_196260_3_.func_177977_b(), Direction.UP, this)) return true;
|
||||
Block block = p_196260_2_.func_180495_p(p_196260_3_.func_177977_b()).func_177230_c();
|
||||
if (block == this) {
|
||||
return true;
|
||||
@@ -87,4 +92,14 @@
|
||||
protected void func_206840_a(StateContainer.Builder<Block, BlockState> p_206840_1_) {
|
||||
p_206840_1_.func_206894_a(field_176355_a);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.PlantType getPlantType(IBlockReader world, BlockPos pos) {
|
||||
+ return net.minecraftforge.common.PlantType.Beach;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public BlockState getPlant(IBlockReader world, BlockPos pos) {
|
||||
+ return func_176223_P();
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/TallGrassBlock.java
|
||||
+++ b/net/minecraft/block/TallGrassBlock.java
|
||||
@@ -7,7 +7,7 @@
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class TallGrassBlock extends BushBlock implements IGrowable {
|
||||
+public class TallGrassBlock extends BushBlock 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 TallGrassBlock(Block.Properties p_i48310_1_) {
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/block/TrapDoorBlock.java
|
||||
+++ b/net/minecraft/block/TrapDoorBlock.java
|
||||
@@ -151,4 +151,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(BlockState state, net.minecraft.world.IWorldReader world, BlockPos pos, net.minecraft.entity.LivingEntity entity) {
|
||||
+ if (state.func_177229_b(field_176283_b)) {
|
||||
+ BlockState down = world.func_180495_p(pos.func_177977_b());
|
||||
+ if (down.func_177230_c() == net.minecraft.block.Blocks.field_150468_ap)
|
||||
+ return down.func_177229_b(LadderBlock.field_176382_a) == state.func_177229_b(field_185512_D);
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/block/VineBlock.java
|
||||
+++ b/net/minecraft/block/VineBlock.java
|
||||
@@ -20,7 +20,7 @@
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class VineBlock extends Block {
|
||||
+public class VineBlock extends Block implements net.minecraftforge.common.IShearable {
|
||||
public static final BooleanProperty field_176277_a = SixWayBlock.field_196496_z;
|
||||
public static final BooleanProperty field_176273_b = SixWayBlock.field_196488_a;
|
||||
public static final BooleanProperty field_176278_M = SixWayBlock.field_196490_b;
|
||||
@@ -154,7 +154,7 @@
|
||||
p_196267_2_.func_217377_a(p_196267_3_, false);
|
||||
}
|
||||
|
||||
- } 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_.isAreaLoaded(p_196267_3_, 4)) { // Forge: check area to prevent loading unloaded chunks
|
||||
Direction direction = Direction.func_176741_a(p_196267_4_);
|
||||
BlockPos blockpos = p_196267_3_.func_177984_a();
|
||||
if (direction.func_176740_k().func_176722_c() && !p_196267_1_.func_177229_b(func_176267_a(direction))) {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/net/minecraft/block/WebBlock.java
|
||||
+++ b/net/minecraft/block/WebBlock.java
|
||||
@@ -6,7 +6,7 @@
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
-public class WebBlock extends Block {
|
||||
+public class WebBlock extends Block implements net.minecraftforge.common.IShearable {
|
||||
public WebBlock(Block.Properties p_i48296_1_) {
|
||||
super(p_i48296_1_);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/block/state/IBlockState.java
|
||||
+++ b/net/minecraft/block/state/IBlockState.java
|
||||
@@ -30,7 +30,7 @@
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
-public interface IBlockState extends IStateHolder<IBlockState> {
|
||||
+public interface IBlockState extends IStateHolder<IBlockState>, net.minecraftforge.common.extensions.IForgeBlockState {
|
||||
ThreadLocal<Object2ByteMap<IBlockState>> field_208776_a = ThreadLocal.<Object2ByteMap<IBlockState>>withInitial(() -> {
|
||||
Object2ByteOpenHashMap<IBlockState> object2byteopenhashmap = new Object2ByteOpenHashMap<IBlockState>();
|
||||
object2byteopenhashmap.defaultReturnValue((byte)127);
|
||||
@@ -0,0 +1,53 @@
|
||||
--- a/net/minecraft/block/state/PistonBlockStructureHelper.java
|
||||
+++ b/net/minecraft/block/state/PistonBlockStructureHelper.java
|
||||
@@ -52,7 +52,7 @@
|
||||
} else {
|
||||
for(int i = 0; i < this.field_177258_e.size(); ++i) {
|
||||
BlockPos blockpos = this.field_177258_e.get(i);
|
||||
- if (this.field_177261_a.func_180495_p(blockpos).func_177230_c() == Blocks.field_180399_cE && !this.func_177250_b(blockpos)) {
|
||||
+ if (this.field_177261_a.func_180495_p(blockpos).isStickyBlock() && !this.func_177250_b(blockpos)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -63,8 +63,7 @@
|
||||
|
||||
private boolean func_177251_a(BlockPos p_177251_1_, Direction p_177251_2_) {
|
||||
BlockState blockstate = this.field_177261_a.func_180495_p(p_177251_1_);
|
||||
- Block block = blockstate.func_177230_c();
|
||||
- if (blockstate.func_196958_f()) {
|
||||
+ if (field_177261_a.func_175623_d(p_177251_1_)) {
|
||||
return true;
|
||||
} else if (!PistonBlock.func_185646_a(blockstate, this.field_177261_a, p_177251_1_, this.field_177257_d, false, p_177251_2_)) {
|
||||
return true;
|
||||
@@ -77,11 +76,10 @@
|
||||
if (i + this.field_177258_e.size() > 12) {
|
||||
return false;
|
||||
} else {
|
||||
- while(block == Blocks.field_180399_cE) {
|
||||
+ while(blockstate.isStickyBlock()) {
|
||||
BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i);
|
||||
blockstate = this.field_177261_a.func_180495_p(blockpos);
|
||||
- block = blockstate.func_177230_c();
|
||||
- if (blockstate.func_196958_f() || !PistonBlock.func_185646_a(blockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) {
|
||||
+ if (blockstate.isAir(this.field_177261_a, blockpos) || !PistonBlock.func_185646_a(blockstate, this.field_177261_a, blockpos, this.field_177257_d, false, this.field_177257_d.func_176734_d()) || blockpos.equals(this.field_177259_b)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -108,7 +106,7 @@
|
||||
|
||||
for(int l = 0; l <= k + i1; ++l) {
|
||||
BlockPos blockpos2 = this.field_177258_e.get(l);
|
||||
- if (this.field_177261_a.func_180495_p(blockpos2).func_177230_c() == Blocks.field_180399_cE && !this.func_177250_b(blockpos2)) {
|
||||
+ if (this.field_177261_a.func_180495_p(blockpos2).isStickyBlock() && !this.func_177250_b(blockpos2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +115,7 @@
|
||||
}
|
||||
|
||||
blockstate = this.field_177261_a.func_180495_p(blockpos1);
|
||||
- if (blockstate.func_196958_f()) {
|
||||
+ if (blockstate.isAir(field_177261_a, blockpos1)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/net/minecraft/block/trees/JungleTree.java
|
||||
+++ b/net/minecraft/block/trees/JungleTree.java
|
||||
@@ -11,11 +11,11 @@
|
||||
public class JungleTree extends BigTree {
|
||||
@Nullable
|
||||
protected AbstractTreeFeature<NoFeatureConfig> func_196936_b(Random p_196936_1_) {
|
||||
- return new TreeFeature(NoFeatureConfig::func_214639_a, true, 4 + p_196936_1_.nextInt(7), Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P(), false);
|
||||
+ return new TreeFeature(NoFeatureConfig::func_214639_a, true, 4 + p_196936_1_.nextInt(7), Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P(), false).setSapling((net.minecraft.block.SaplingBlock)Blocks.field_196678_w);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected AbstractTreeFeature<NoFeatureConfig> func_196938_a(Random p_196938_1_) {
|
||||
- return new MegaJungleFeature(NoFeatureConfig::func_214639_a, true, 10, 20, Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P());
|
||||
+ return new MegaJungleFeature(NoFeatureConfig::func_214639_a, true, 10, 20, Blocks.field_196620_N.func_176223_P(), Blocks.field_196648_Z.func_176223_P()).setSapling((net.minecraft.block.SaplingBlock)Blocks.field_196678_w);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
--- a/net/minecraft/client/GameSettings.java
|
||||
+++ b/net/minecraft/client/GameSettings.java
|
||||
@@ -142,7 +142,7 @@
|
||||
public final KeyBinding[] field_151456_ac = new KeyBinding[]{new KeyBinding("key.hotbar.1", 49, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 50, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 51, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 52, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 53, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 54, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 55, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 56, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 57, "key.categories.inventory")};
|
||||
public final KeyBinding field_193629_ap = new KeyBinding("key.saveToolbarActivator", 67, "key.categories.creative");
|
||||
public final KeyBinding field_193630_aq = new KeyBinding("key.loadToolbarActivator", 88, "key.categories.creative");
|
||||
- public final KeyBinding[] field_74324_K = ArrayUtils.addAll(new KeyBinding[]{this.field_74312_F, this.field_74313_G, this.field_74351_w, this.field_74370_x, this.field_74368_y, this.field_74366_z, this.field_74314_A, this.field_74311_E, this.field_151444_V, this.field_74316_C, this.field_151445_Q, this.field_74310_D, this.field_74321_H, this.field_74322_I, this.field_74323_J, this.field_151447_Z, this.field_151457_aa, this.field_151458_ab, this.field_152395_am, this.field_178883_an, this.field_186718_X, this.field_193629_ap, this.field_193630_aq, this.field_194146_ao}, this.field_151456_ac);
|
||||
+ public KeyBinding[] field_74324_K = ArrayUtils.addAll(new KeyBinding[]{this.field_74312_F, this.field_74313_G, this.field_74351_w, this.field_74370_x, this.field_74368_y, this.field_74366_z, this.field_74314_A, this.field_74311_E, this.field_151444_V, this.field_74316_C, this.field_151445_Q, this.field_74310_D, this.field_74321_H, this.field_74322_I, this.field_74323_J, this.field_151447_Z, this.field_151457_aa, this.field_151458_ab, this.field_152395_am, this.field_178883_an, this.field_186718_X, this.field_193629_ap, this.field_193630_aq, this.field_194146_ao}, this.field_151456_ac);
|
||||
protected Minecraft field_74317_L;
|
||||
private final File field_74354_ai;
|
||||
public Difficulty field_74318_M = Difficulty.NORMAL;
|
||||
@@ -161,6 +161,7 @@
|
||||
public String field_74363_ab = "en_us";
|
||||
|
||||
public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
|
||||
+ setForgeKeybindProperties();
|
||||
this.field_74317_L = p_i46326_1_;
|
||||
this.field_74354_ai = new File(p_i46326_2_, "options.txt");
|
||||
if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
|
||||
@@ -462,7 +463,11 @@
|
||||
|
||||
for(KeyBinding keybinding : this.field_74324_K) {
|
||||
if (s1.equals("key_" + keybinding.func_151464_g())) {
|
||||
- keybinding.func_197979_b(InputMappings.func_197955_a(s2));
|
||||
+ if (s2.indexOf(':') != -1) {
|
||||
+ String[] pts = s2.split(":");
|
||||
+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueFromString(pts[1]), InputMappings.func_197955_a(pts[0]));
|
||||
+ } else
|
||||
+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, InputMappings.func_197955_a(s2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,6 +515,7 @@
|
||||
}
|
||||
|
||||
public void func_74303_b() {
|
||||
+ if (net.minecraftforge.fml.client.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
|
||||
try (PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.field_74354_ai), StandardCharsets.UTF_8))) {
|
||||
printwriter.println("version:" + SharedConstants.func_215069_a().getWorldVersion());
|
||||
printwriter.println("autoJump:" + AbstractOption.field_216719_z.func_216741_b(this));
|
||||
@@ -583,7 +589,7 @@
|
||||
printwriter.println("glDebugVerbosity:" + this.field_209231_W);
|
||||
|
||||
for(KeyBinding keybinding : this.field_74324_K) {
|
||||
- printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_197982_m());
|
||||
+ printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_197982_m() + (keybinding.getKeyModifier() != net.minecraftforge.client.settings.KeyModifier.NONE ? ":" + keybinding.getKeyModifier() : ""));
|
||||
}
|
||||
|
||||
for(SoundCategory soundcategory : SoundCategory.values()) {
|
||||
@@ -680,6 +686,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (net.minecraftforge.fml.client.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
|
||||
p_198017_1_.func_198985_a(set);
|
||||
}
|
||||
+
|
||||
+ private void setForgeKeybindProperties() {
|
||||
+ net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME;
|
||||
+ field_74351_w.setKeyConflictContext(inGame);
|
||||
+ field_74370_x.setKeyConflictContext(inGame);
|
||||
+ field_74368_y.setKeyConflictContext(inGame);
|
||||
+ field_74366_z.setKeyConflictContext(inGame);
|
||||
+ field_74314_A.setKeyConflictContext(inGame);
|
||||
+ field_74311_E.setKeyConflictContext(inGame);
|
||||
+ field_151444_V.setKeyConflictContext(inGame);
|
||||
+ field_74312_F.setKeyConflictContext(inGame);
|
||||
+ field_74310_D.setKeyConflictContext(inGame);
|
||||
+ field_74321_H.setKeyConflictContext(inGame);
|
||||
+ field_74323_J.setKeyConflictContext(inGame);
|
||||
+ field_151457_aa.setKeyConflictContext(inGame);
|
||||
+ field_151458_ab.setKeyConflictContext(inGame);
|
||||
+ field_186718_X.setKeyConflictContext(inGame);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
--- a/net/minecraft/client/KeyboardListener.java
|
||||
+++ b/net/minecraft/client/KeyboardListener.java
|
||||
@@ -252,7 +252,9 @@
|
||||
}
|
||||
|
||||
INestedGuiEventHandler inestedguieventhandler = this.field_197972_a.field_71462_r;
|
||||
- if (p_197961_5_ == 1 && (!(this.field_197972_a.field_71462_r instanceof ControlsScreen) || ((ControlsScreen)inestedguieventhandler).field_152177_g <= Util.func_211177_b() - 20L)) {
|
||||
+
|
||||
+ if ((!(this.field_197972_a.field_71462_r instanceof ControlsScreen) || ((ControlsScreen)inestedguieventhandler).field_152177_g <= Util.func_211177_b() - 20L)) {
|
||||
+ if (p_197961_5_ == 1) {
|
||||
if (this.field_197972_a.field_71474_y.field_152395_am.func_197976_a(p_197961_3_, p_197961_4_)) {
|
||||
this.field_197972_a.field_195558_d.func_198077_g();
|
||||
this.field_197972_a.field_71474_y.field_74353_u = this.field_197972_a.field_195558_d.func_198113_j();
|
||||
@@ -271,6 +273,8 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
+ } else if (p_197961_5_ == 0 /*GLFW_RELEASE*/ && this.field_197972_a.field_71462_r instanceof ControlsScreen)
|
||||
+ ((ControlsScreen)this.field_197972_a.field_71462_r).field_146491_f = null; //Forge: Unset pure modifiers.
|
||||
}
|
||||
|
||||
boolean flag = inestedguieventhandler == null || !(inestedguieventhandler.getFocused() instanceof TextFieldWidget) || !((TextFieldWidget)inestedguieventhandler.getFocused()).func_212955_f();
|
||||
@@ -290,10 +294,14 @@
|
||||
Screen.wrapScreenError(() -> {
|
||||
if (p_197961_5_ != 1 && (p_197961_5_ != 2 || !this.field_197973_b)) {
|
||||
if (p_197961_5_ == 0) {
|
||||
- aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.keyReleased(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyReleasedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
}
|
||||
} else {
|
||||
- aboolean[0] = inestedguieventhandler.keyPressed(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyPressedPre(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = inestedguieventhandler.keyPressed(p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiKeyPressedPost(this.field_197972_a.field_71462_r, p_197961_3_, p_197961_4_, p_197961_6_);
|
||||
}
|
||||
|
||||
}, "keyPressed event handler", inestedguieventhandler.getClass().getCanonicalName());
|
||||
@@ -354,7 +362,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.client.ForgeHooksClient.fireKeyInput(p_197961_3_, p_197961_4_, p_197961_5_, p_197961_6_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,12 +372,16 @@
|
||||
if (iguieventlistener != null && this.field_197972_a.func_213250_au() == null) {
|
||||
if (Character.charCount(p_197963_3_) == 1) {
|
||||
Screen.wrapScreenError(() -> {
|
||||
- iguieventlistener.charTyped((char)p_197963_3_, p_197963_4_);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPre(this.field_197972_a.field_71462_r, (char)p_197963_3_, p_197963_4_)) return;
|
||||
+ if (iguieventlistener.charTyped((char)p_197963_3_, p_197963_4_)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPost(this.field_197972_a.field_71462_r, (char)p_197963_3_, p_197963_4_);
|
||||
}, "charTyped event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
} else {
|
||||
for(char c0 : Character.toChars(p_197963_3_)) {
|
||||
Screen.wrapScreenError(() -> {
|
||||
- iguieventlistener.charTyped(c0, p_197963_4_);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPre(this.field_197972_a.field_71462_r, c0, p_197963_4_)) return;
|
||||
+ if (iguieventlistener.charTyped(c0, p_197963_4_)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiCharTypedPost(this.field_197972_a.field_71462_r, c0, p_197963_4_);
|
||||
}, "charTyped event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
@@ -1,43 +1,406 @@
|
||||
--- a/net/minecraft/client/Minecraft.java
|
||||
+++ b/net/minecraft/client/Minecraft.java
|
||||
@@ -405,6 +405,7 @@
|
||||
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
|
||||
this.field_110451_am.func_199006_a(this.field_135017_as);
|
||||
@@ -316,6 +316,7 @@
|
||||
super("Client");
|
||||
this.field_195556_O = p_i45547_1_.field_178743_b;
|
||||
field_71432_P = this;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.invalidateLog4jThreadCache();
|
||||
this.field_71412_D = p_i45547_1_.field_178744_c.field_178760_a;
|
||||
this.field_110446_Y = p_i45547_1_.field_178744_c.field_178759_c;
|
||||
this.field_130070_K = p_i45547_1_.field_178744_c.field_178758_b;
|
||||
@@ -333,7 +334,7 @@
|
||||
supplier = p_213262_2_;
|
||||
}
|
||||
|
||||
- return new ClientResourcePackInfo(p_213262_0_, p_213262_1_, supplier, p_213262_3_, p_213262_4_, p_213262_5_);
|
||||
+ return new ClientResourcePackInfo(p_213262_0_, p_213262_1_, supplier, p_213262_3_, p_213262_4_, p_213262_5_, p_213262_3_.isHidden());
|
||||
});
|
||||
this.field_110448_aq.func_198982_a(this.field_195554_ax);
|
||||
this.field_110448_aq.func_198982_a(new FolderPackFinder(this.field_130070_K));
|
||||
@@ -341,7 +342,6 @@
|
||||
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
|
||||
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
|
||||
field_147123_G.info("Setting user: {}", (Object)this.field_71449_j.func_111285_a());
|
||||
- field_147123_G.debug("(Session ID is {})", (Object)this.field_71449_j.func_111286_b());
|
||||
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
|
||||
this.field_147129_ai = func_147122_X();
|
||||
this.field_71437_Z = null;
|
||||
@@ -451,6 +451,7 @@
|
||||
this.field_147124_at.func_147604_a(0.0F, 0.0F, 0.0F, 0.0F);
|
||||
this.field_110451_am = new SimpleReloadableResourceManager(ResourcePackType.CLIENT_RESOURCES, this.field_152352_aC);
|
||||
this.field_71474_y.func_198017_a(this.field_110448_aq);
|
||||
+ net.minecraftforge.fml.client.ClientModLoader.begin(this, this.field_110448_aq, this.field_110451_am, this.field_195554_ax);
|
||||
this.func_110436_a();
|
||||
this.field_71446_o = new TextureManager(this.field_110451_am);
|
||||
this.field_110451_am.func_199006_a(this.field_71446_o);
|
||||
@@ -461,6 +462,7 @@
|
||||
this.field_110451_am.func_199006_a(this.field_193995_ae);
|
||||
GlStateManager.func_179083_b(0, 0, this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
|
||||
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
|
||||
+ net.minecraftforge.fml.client.ClientModLoader.end();
|
||||
this.field_71456_v = new GuiIngame(this);
|
||||
if (this.field_71475_ae != null) {
|
||||
this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
|
||||
@@ -470,6 +472,7 @@
|
||||
this.field_110448_aq.func_198983_a();
|
||||
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
|
||||
|
||||
@@ -463,6 +464,7 @@
|
||||
this.field_135017_as.func_135043_a(list);
|
||||
this.field_71446_o = new TextureManager(this.field_110451_am);
|
||||
this.field_110451_am.func_219534_a(this.field_71446_o);
|
||||
+ //net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.textureManager);
|
||||
this.func_213226_a();
|
||||
this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
|
||||
this.field_71469_aa = new SaveFormat(this.field_71412_D.toPath().resolve("saves"), this.field_71412_D.toPath().resolve("backups"), this.field_184131_U);
|
||||
@@ -480,11 +482,14 @@
|
||||
|
||||
this.field_110451_am.func_219534_a(new GrassColorReloadListener());
|
||||
this.field_110451_am.func_219534_a(new FoliageColorReloadListener());
|
||||
+ try (net.minecraftforge.fml.common.progress.ProgressBar bar = net.minecraftforge.fml.common.progress.StartupProgressManager.start("Rendering Setup", 5, true)) {
|
||||
+ bar.step("GL Setup");
|
||||
this.field_195558_d.func_198076_a("Startup");
|
||||
GlStateManager.enableTexture();
|
||||
GlStateManager.shadeModel(7425);
|
||||
GlStateManager.clearDepth(1.0D);
|
||||
GlStateManager.enableDepthTest();
|
||||
+ net.minecraftforge.fml.client.ClientModLoader.complete();
|
||||
GlStateManager.depthFunc(515);
|
||||
GlStateManager.enableAlphaTest();
|
||||
GlStateManager.alphaFunc(516, 0.1F);
|
||||
@@ -493,19 +498,24 @@
|
||||
GlStateManager.loadIdentity();
|
||||
GlStateManager.matrixMode(5888);
|
||||
this.field_195558_d.func_198076_a("Post startup");
|
||||
+ bar.step("Loading Texture Map");
|
||||
this.field_147128_au = new AtlasTexture("textures");
|
||||
this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
|
||||
this.field_71446_o.func_110580_a(AtlasTexture.field_110575_b, this.field_147128_au);
|
||||
this.field_71446_o.func_110577_a(AtlasTexture.field_110575_b);
|
||||
this.field_147128_au.func_174937_a(false, this.field_71474_y.field_151442_I > 0);
|
||||
+ bar.step("Loading Model Manager");
|
||||
this.field_175617_aL = new ModelManager(this.field_147128_au);
|
||||
this.field_110451_am.func_219534_a(this.field_175617_aL);
|
||||
this.field_184127_aH = BlockColors.func_186723_a();
|
||||
this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
|
||||
+ bar.step("Loading Item Renderer");
|
||||
this.field_175621_X = new ItemRenderer(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
|
||||
this.field_175616_W = new EntityRendererManager(this.field_71446_o, this.field_175621_X, this.field_110451_am);
|
||||
this.field_175620_Y = new FirstPersonRenderer(this);
|
||||
this.field_110451_am.func_219534_a(this.field_175621_X);
|
||||
+ bar.step("Loading Entity Renderer");
|
||||
+ //net.minecraftforge.fml.client.SplashProgress.pause();
|
||||
this.field_71460_t = new GameRenderer(this, this.field_110451_am);
|
||||
this.field_110451_am.func_219534_a(this.field_71460_t);
|
||||
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
|
||||
@@ -521,9 +531,13 @@
|
||||
this.field_110451_am.func_219534_a(this.field_213272_aL);
|
||||
this.field_213273_aM = new PotionSpriteUploader(this.field_71446_o);
|
||||
this.field_110451_am.func_219534_a(this.field_213273_aM);
|
||||
- this.field_71456_v = new IngameGui(this);
|
||||
+ //net.minecraftforge.fml.client.SplashProgress.resume();
|
||||
+ }; // Forge: end progress bar
|
||||
+ net.minecraftforge.fml.client.ClientModLoader.end();
|
||||
+ this.field_71456_v = new net.minecraftforge.client.ForgeIngameGui(this);
|
||||
this.field_184132_p = new DebugRenderer(this);
|
||||
GLFW.glfwSetErrorCallback(this::func_195545_a).free();
|
||||
GLX.setGlfwErrorCallback(this::func_195545_a);
|
||||
+ net.minecraftforge.fml.client.ClientModLoader.complete();
|
||||
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
|
||||
this.field_195558_d.func_198077_g();
|
||||
this.field_71474_y.field_74353_u = this.field_195558_d.func_198113_j();
|
||||
@@ -646,7 +660,7 @@
|
||||
Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
|
||||
if (p_71377_1_.func_71497_f() != null) {
|
||||
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f());
|
||||
- System.exit(-1);
|
||||
+ net.minecraftforge.fml.server.ServerLifecycleHooks.handleExit(-1);
|
||||
} else if (p_71377_1_.func_147149_a(file2)) {
|
||||
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
|
||||
System.exit(-1);
|
||||
@@ -661,6 +675,7 @@
|
||||
return this.field_71474_y.field_211842_aO;
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: Use selective refreshResources method in FMLClientHandler
|
||||
public CompletableFuture<Void> func_213237_g() {
|
||||
if (this.field_213276_aV != null) {
|
||||
return this.field_213276_aV;
|
||||
@@ -740,16 +755,20 @@
|
||||
}
|
||||
|
||||
public void func_147108_a(@Nullable Screen p_147108_1_) {
|
||||
- if (this.field_71462_r != null) {
|
||||
- this.field_71462_r.removed();
|
||||
- }
|
||||
-
|
||||
if (p_147108_1_ == null && this.field_71441_e == null) {
|
||||
p_147108_1_ = new MainMenuScreen();
|
||||
} else if (p_147108_1_ == null && this.field_71439_g.func_110143_aJ() <= 0.0F) {
|
||||
p_147108_1_ = new DeathScreen((ITextComponent)null, this.field_71441_e.func_72912_H().func_76093_s());
|
||||
}
|
||||
@@ -485,7 +488,7 @@
|
||||
});
|
||||
List<String> list = Lists.<String>newArrayList();
|
||||
GLFWErrorCallback glfwerrorcallback = GLFW.glfwSetErrorCallback((p_211100_1_, p_211100_2_) -> {
|
||||
- list.add(String.format("GLFW error during init: [0x%X]%s", p_211100_1_, p_211100_2_));
|
||||
+ list.add(String.format("GLFW error during init: [0x%X] %s", p_211100_1_, GLFWErrorCallback.getDescription(p_211100_2_)));
|
||||
});
|
||||
if (!GLFW.glfwInit()) {
|
||||
throw new IllegalStateException("Failed to initialize GLFW, errors: " + Joiner.on(",").join(list));
|
||||
@@ -1392,6 +1395,7 @@
|
||||
NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
|
||||
networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {
|
||||
|
||||
+ Screen old = this.field_71462_r;
|
||||
+ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_);
|
||||
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
|
||||
+
|
||||
+ p_147108_1_ = event.getGui();
|
||||
+ if (old != null && p_147108_1_ != old)
|
||||
+ old.removed();
|
||||
+
|
||||
if (p_147108_1_ instanceof MainMenuScreen || p_147108_1_ instanceof MultiplayerScreen) {
|
||||
this.field_71474_y.field_74330_P = false;
|
||||
this.field_71456_v.func_146158_b().func_146231_a(true);
|
||||
@@ -874,11 +893,13 @@
|
||||
GlStateManager.enableTexture();
|
||||
this.field_71424_I.func_76319_b();
|
||||
if (!this.field_71454_w) {
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickStart(this.field_71428_T.field_194147_b);
|
||||
this.field_71424_I.func_219895_b("gameRenderer");
|
||||
this.field_71460_t.func_195458_a(this.field_71445_n ? this.field_193996_ah : this.field_71428_T.field_194147_b, i, p_195542_1_);
|
||||
this.field_71424_I.func_219895_b("toasts");
|
||||
this.field_193034_aS.func_195625_a();
|
||||
this.field_71424_I.func_76319_b();
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onRenderTickEnd(this.field_71428_T.field_194147_b);
|
||||
}
|
||||
|
||||
this.field_71424_I.func_219897_b();
|
||||
@@ -1146,10 +1167,10 @@
|
||||
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.func_216346_c() == RayTraceResult.Type.BLOCK) {
|
||||
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
|
||||
BlockPos blockpos = blockraytraceresult.func_216350_a();
|
||||
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) {
|
||||
- Direction direction = blockraytraceresult.func_216354_b();
|
||||
+ Direction direction = blockraytraceresult.func_216354_b();
|
||||
+ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, direction)) {
|
||||
if (this.field_71442_b.func_180512_c(blockpos, direction)) {
|
||||
- this.field_71452_i.func_180532_a(blockpos, direction);
|
||||
+ this.field_71452_i.addBlockHitEffects(blockpos, blockraytraceresult);
|
||||
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
@@ -1176,7 +1197,7 @@
|
||||
case BLOCK:
|
||||
BlockRayTraceResult blockraytraceresult = (BlockRayTraceResult)this.field_71476_x;
|
||||
BlockPos blockpos = blockraytraceresult.func_216350_a();
|
||||
- if (!this.field_71441_e.func_180495_p(blockpos).func_196958_f()) {
|
||||
+ if (!this.field_71441_e.func_180495_p(blockpos).isAir(field_71441_e, blockpos)) {
|
||||
this.field_71442_b.func_180511_b(blockpos, blockraytraceresult.func_216354_b());
|
||||
break;
|
||||
}
|
||||
@@ -1186,6 +1207,7 @@
|
||||
}
|
||||
|
||||
this.field_71439_g.func_184821_cY();
|
||||
+ net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(this.field_71439_g);
|
||||
}
|
||||
|
||||
this.field_71439_g.func_184609_a(Hand.MAIN_HAND);
|
||||
@@ -1235,6 +1257,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (itemstack.func_190926_b() && (this.field_71476_x == null || this.field_71476_x.func_216346_c() == RayTraceResult.Type.MISS))
|
||||
+ net.minecraftforge.common.ForgeHooks.onEmptyClick(this.field_71439_g, hand);
|
||||
+
|
||||
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, hand) == ActionResultType.SUCCESS) {
|
||||
this.field_71460_t.field_78516_c.func_187460_a(hand);
|
||||
return;
|
||||
@@ -1254,6 +1279,8 @@
|
||||
--this.field_71467_ac;
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPreClientTick();
|
||||
+
|
||||
this.field_71424_I.func_76320_a("gui");
|
||||
if (!this.field_71445_n) {
|
||||
this.field_71456_v.func_73831_a();
|
||||
@@ -1372,6 +1399,8 @@
|
||||
this.field_71424_I.func_219895_b("keyboard");
|
||||
this.field_195559_v.func_204870_b();
|
||||
this.field_71424_I.func_76319_b();
|
||||
+
|
||||
+ net.minecraftforge.fml.hooks.BasicEventHooks.onPostClientTick();
|
||||
}
|
||||
|
||||
private void func_184117_aA() {
|
||||
@@ -1430,6 +1459,7 @@
|
||||
this.field_71439_g.func_71040_bB(Screen.hasControlDown());
|
||||
}
|
||||
}
|
||||
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
|
||||
|
||||
boolean flag2 = this.field_71474_y.field_74343_n != ChatVisibility.HIDDEN;
|
||||
if (flag2) {
|
||||
@@ -1526,6 +1556,12 @@
|
||||
this.func_147108_a(worldloadprogressscreen);
|
||||
|
||||
while(!this.field_71437_Z.func_71200_ad()) {
|
||||
+ if (!net.minecraftforge.fml.StartupQuery.check() || this.field_71437_Z.func_71241_aa()) {
|
||||
+ this.func_147108_a(null);
|
||||
+ return;
|
||||
+ } else if (this.field_71462_r == null) // if we're showing nothing, put the working screen back again
|
||||
+ this.func_147108_a(worldloadprogressscreen);
|
||||
+
|
||||
worldloadprogressscreen.tick();
|
||||
this.func_195542_b(false);
|
||||
|
||||
@@ -1546,11 +1582,17 @@
|
||||
networkmanager.func_150719_a(new ClientLoginNetHandler(networkmanager, this, (Screen)null, (p_213261_0_) -> {
|
||||
}));
|
||||
+ net.minecraftforge.fml.network.NetworkHooks.registerClientLoginChannel(networkmanager);
|
||||
networkmanager.func_179290_a(new CPacketHandshake(socketaddress.toString(), 0, EnumConnectionState.LOGIN));
|
||||
networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
|
||||
networkmanager.func_179290_a(new CHandshakePacket(socketaddress.toString(), 0, ProtocolType.LOGIN));
|
||||
- networkmanager.func_179290_a(new CLoginStartPacket(this.func_110432_I().func_148256_e()));
|
||||
+ com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e();
|
||||
+ if (!this.func_110432_I().hasCachedProperties()) {
|
||||
+ gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974.
|
||||
+ this.func_110432_I().setProperties(gameProfile.getProperties());
|
||||
+ }
|
||||
+ networkmanager.func_179290_a(new CLoginStartPacket(gameProfile));
|
||||
this.field_71453_ak = networkmanager;
|
||||
}
|
||||
|
||||
public void func_71403_a(ClientWorld p_71403_1_) {
|
||||
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
|
||||
WorkingScreen workingscreen = new WorkingScreen();
|
||||
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
|
||||
this.func_213241_c(workingscreen);
|
||||
@@ -1623,6 +1665,7 @@
|
||||
}
|
||||
|
||||
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
|
||||
+ net.minecraftforge.client.MinecraftForgeClient.clearRenderCache();
|
||||
}
|
||||
|
||||
public final boolean func_71355_q() {
|
||||
@@ -1648,112 +1691,8 @@
|
||||
|
||||
private void func_147112_ai() {
|
||||
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
|
||||
- boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
|
||||
- TileEntity tileentity = null;
|
||||
- RayTraceResult.Type raytraceresult$type = this.field_71476_x.func_216346_c();
|
||||
- ItemStack itemstack;
|
||||
- if (raytraceresult$type == RayTraceResult.Type.BLOCK) {
|
||||
- BlockPos blockpos = ((BlockRayTraceResult)this.field_71476_x).func_216350_a();
|
||||
- BlockState blockstate = this.field_71441_e.func_180495_p(blockpos);
|
||||
- Block block = blockstate.func_177230_c();
|
||||
- if (blockstate.func_196958_f()) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- itemstack = block.func_185473_a(this.field_71441_e, blockpos, blockstate);
|
||||
- if (itemstack.func_190926_b()) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (flag && Screen.hasControlDown() && block.func_149716_u()) {
|
||||
- tileentity = this.field_71441_e.func_175625_s(blockpos);
|
||||
- }
|
||||
- } else {
|
||||
- if (raytraceresult$type != RayTraceResult.Type.ENTITY || !flag) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- Entity entity = ((EntityRayTraceResult)this.field_71476_x).func_216348_a();
|
||||
- if (entity instanceof PaintingEntity) {
|
||||
- itemstack = new ItemStack(Items.field_151159_an);
|
||||
- } else if (entity instanceof LeashKnotEntity) {
|
||||
- itemstack = new ItemStack(Items.field_151058_ca);
|
||||
- } else if (entity instanceof ItemFrameEntity) {
|
||||
- ItemFrameEntity itemframeentity = (ItemFrameEntity)entity;
|
||||
- ItemStack itemstack1 = itemframeentity.func_82335_i();
|
||||
- if (itemstack1.func_190926_b()) {
|
||||
- itemstack = new ItemStack(Items.field_151160_bD);
|
||||
- } else {
|
||||
- itemstack = itemstack1.func_77946_l();
|
||||
- }
|
||||
- } else if (entity instanceof AbstractMinecartEntity) {
|
||||
- AbstractMinecartEntity abstractminecartentity = (AbstractMinecartEntity)entity;
|
||||
- Item item;
|
||||
- switch(abstractminecartentity.func_184264_v()) {
|
||||
- case FURNACE:
|
||||
- item = Items.field_151109_aJ;
|
||||
- break;
|
||||
- case CHEST:
|
||||
- item = Items.field_151108_aI;
|
||||
- break;
|
||||
- case TNT:
|
||||
- item = Items.field_151142_bV;
|
||||
- break;
|
||||
- case HOPPER:
|
||||
- item = Items.field_151140_bW;
|
||||
- break;
|
||||
- case COMMAND_BLOCK:
|
||||
- item = Items.field_151095_cc;
|
||||
- break;
|
||||
- default:
|
||||
- item = Items.field_151143_au;
|
||||
- }
|
||||
-
|
||||
- itemstack = new ItemStack(item);
|
||||
- } else if (entity instanceof BoatEntity) {
|
||||
- itemstack = new ItemStack(((BoatEntity)entity).func_184455_j());
|
||||
- } else if (entity instanceof ArmorStandEntity) {
|
||||
- itemstack = new ItemStack(Items.field_179565_cj);
|
||||
- } else if (entity instanceof EnderCrystalEntity) {
|
||||
- itemstack = new ItemStack(Items.field_185158_cP);
|
||||
- } else {
|
||||
- SpawnEggItem spawneggitem = SpawnEggItem.func_200889_b(entity.func_200600_R());
|
||||
- if (spawneggitem == null) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- itemstack = new ItemStack(spawneggitem);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (itemstack.func_190926_b()) {
|
||||
- String s = "";
|
||||
- if (raytraceresult$type == RayTraceResult.Type.BLOCK) {
|
||||
- s = Registry.field_212618_g.func_177774_c(this.field_71441_e.func_180495_p(((BlockRayTraceResult)this.field_71476_x).func_216350_a()).func_177230_c()).toString();
|
||||
- } else if (raytraceresult$type == RayTraceResult.Type.ENTITY) {
|
||||
- s = Registry.field_212629_r.func_177774_c(((EntityRayTraceResult)this.field_71476_x).func_216348_a().func_200600_R()).toString();
|
||||
- }
|
||||
-
|
||||
- field_147123_G.warn("Picking on: [{}] {} gave null item", raytraceresult$type, s);
|
||||
- } else {
|
||||
- PlayerInventory playerinventory = this.field_71439_g.field_71071_by;
|
||||
- if (tileentity != null) {
|
||||
- this.func_184119_a(itemstack, tileentity);
|
||||
- }
|
||||
-
|
||||
- int i = playerinventory.func_184429_b(itemstack);
|
||||
- if (flag) {
|
||||
- playerinventory.func_184434_a(itemstack);
|
||||
- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(Hand.MAIN_HAND), 36 + playerinventory.field_70461_c);
|
||||
- } else if (i != -1) {
|
||||
- if (PlayerInventory.func_184435_e(i)) {
|
||||
- playerinventory.field_70461_c = i;
|
||||
- } else {
|
||||
- this.field_71442_b.func_187100_a(i);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- }
|
||||
+ net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e);
|
||||
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1825,6 +1764,7 @@
|
||||
return field_71432_P;
|
||||
}
|
||||
|
||||
+ @Deprecated // Forge: Use selective scheduleResourceRefresh method in FMLClientHandler
|
||||
public CompletableFuture<Void> func_213245_w() {
|
||||
return this.func_213169_a(this::func_213237_g).thenCompose((p_213240_0_) -> {
|
||||
return p_213240_0_;
|
||||
@@ -1968,6 +1908,8 @@
|
||||
}
|
||||
|
||||
public MusicTicker.MusicType func_147109_W() {
|
||||
+ MusicTicker.MusicType type = this.field_71441_e == null || this.field_71441_e.field_73011_w == null ? null : this.field_71441_e.field_73011_w.getMusicType();
|
||||
+ if (type != null) return type;
|
||||
if (this.field_71462_r instanceof WinGameScreen) {
|
||||
return MusicTicker.MusicType.CREDITS;
|
||||
} else if (this.field_71439_g == null) {
|
||||
@@ -2124,4 +2066,12 @@
|
||||
public LoadingGui func_213250_au() {
|
||||
return this.field_213279_p;
|
||||
}
|
||||
+
|
||||
+ public ItemColors getItemColors() {
|
||||
+ return this.field_184128_aI;
|
||||
+ }
|
||||
+
|
||||
+ public SearchTreeManager getSearchTreeManager() {
|
||||
+ return this.field_193995_ae;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
--- a/net/minecraft/client/MouseHelper.java
|
||||
+++ b/net/minecraft/client/MouseHelper.java
|
||||
@@ -77,11 +77,15 @@
|
||||
int p_198023_3_f = p_198023_3_;
|
||||
if (flag) {
|
||||
Screen.wrapScreenError(() -> {
|
||||
- aboolean[0] = this.field_198036_a.field_71462_r.mouseClicked(d0, d1, p_198023_3_f);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseClickedPre(this.field_198036_a.field_71462_r, d0, d1, p_198023_3_f);
|
||||
+ if (!aboolean[0]) aboolean[0] = this.field_198036_a.field_71462_r.mouseClicked(d0, d1, p_198023_3_f);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseClickedPost(this.field_198036_a.field_71462_r, d0, d1, p_198023_3_f);
|
||||
}, "mouseClicked event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
|
||||
} else {
|
||||
Screen.wrapScreenError(() -> {
|
||||
- aboolean[0] = this.field_198036_a.field_71462_r.mouseReleased(d0, d1, p_198023_3_f);
|
||||
+ aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseReleasedPre(this.field_198036_a.field_71462_r, d0, d1, p_198023_3_f);
|
||||
+ if (!aboolean[0]) aboolean[0] = this.field_198036_a.field_71462_r.mouseReleased(d0, d1, p_198023_3_f);
|
||||
+ if (!aboolean[0]) aboolean[0] = net.minecraftforge.client.ForgeHooksClient.onGuiMouseReleasedPost(this.field_198036_a.field_71462_r, d0, d1, p_198023_3_f);
|
||||
}, "mouseReleased event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
@@ -105,7 +109,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+ net.minecraftforge.client.ForgeHooksClient.fireMouseInput(p_198023_3_, p_198023_4_, p_198023_5_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +120,9 @@
|
||||
if (this.field_198036_a.field_71462_r != null) {
|
||||
double d1 = this.field_198040_e * (double)this.field_198036_a.field_195558_d.func_198107_o() / (double)this.field_198036_a.field_195558_d.func_198105_m();
|
||||
double d2 = this.field_198041_f * (double)this.field_198036_a.field_195558_d.func_198087_p() / (double)this.field_198036_a.field_195558_d.func_198083_n();
|
||||
- this.field_198036_a.field_71462_r.mouseScrolled(d1, d2, d0);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiMouseScrollPre(this, this.field_198036_a.field_71462_r, d0)) return;
|
||||
+ if (this.field_198036_a.field_71462_r.mouseScrolled(d1, d2, d0)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiMouseScrollPost(this, this.field_198036_a.field_71462_r, d0);
|
||||
} else if (this.field_198036_a.field_71439_g != null) {
|
||||
if (this.field_200542_o != 0.0D && Math.signum(d0) != Math.signum(this.field_200542_o)) {
|
||||
this.field_200542_o = 0.0D;
|
||||
@@ -168,7 +174,9 @@
|
||||
double d2 = (p_198022_3_ - this.field_198040_e) * (double)this.field_198036_a.field_195558_d.func_198107_o() / (double)this.field_198036_a.field_195558_d.func_198105_m();
|
||||
double d3 = (p_198022_5_ - this.field_198041_f) * (double)this.field_198036_a.field_195558_d.func_198087_p() / (double)this.field_198036_a.field_195558_d.func_198083_n();
|
||||
Screen.wrapScreenError(() -> {
|
||||
- iguieventlistener.mouseDragged(d0, d1, this.field_198042_g, d2, d3);
|
||||
+ if (net.minecraftforge.client.ForgeHooksClient.onGuiMouseDragPre(this.field_198036_a.field_71462_r, d0, d1, this.field_198042_g, d2, d3)) return;
|
||||
+ if (iguieventlistener.mouseDragged(d0, d1, this.field_198042_g, d2, d3)) return;
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onGuiMouseDragPost(this.field_198036_a.field_71462_r, d0, d1, this.field_198042_g, d2, d3);
|
||||
}, "mouseDragged event handler", iguieventlistener.getClass().getCanonicalName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
--- a/net/minecraft/client/audio/SoundEngine.java
|
||||
+++ b/net/minecraft/client/audio/SoundEngine.java
|
||||
@@ -53,6 +53,7 @@
|
||||
this.field_148622_c = p_i50892_1_;
|
||||
this.field_148619_d = p_i50892_2_;
|
||||
this.field_217939_i = new AudioStreamManager(p_i50892_3_);
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundSetupEvent(this));
|
||||
}
|
||||
|
||||
public void func_148596_a() {
|
||||
@@ -68,6 +69,7 @@
|
||||
|
||||
this.func_148613_b();
|
||||
this.func_148608_i();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this));
|
||||
}
|
||||
|
||||
private synchronized void func_148608_i() {
|
||||
@@ -246,6 +248,8 @@
|
||||
|
||||
public void func_148611_c(ISound p_148611_1_) {
|
||||
if (this.field_148617_f) {
|
||||
+ p_148611_1_ = net.minecraftforge.client.ForgeHooksClient.playSound(this, p_148611_1_);
|
||||
+ if (p_148611_1_ == null) return;
|
||||
SoundEventAccessor soundeventaccessor = p_148611_1_.func_184366_a(this.field_148622_c);
|
||||
ResourceLocation resourcelocation = p_148611_1_.func_147650_b();
|
||||
if (soundeventaccessor == null) {
|
||||
@@ -300,11 +304,13 @@
|
||||
p_217930_7_.func_216420_a(vec3d);
|
||||
p_217930_7_.func_216432_b(flag);
|
||||
});
|
||||
+ final ISound isound = p_148611_1_;
|
||||
if (!sound.func_188723_h()) {
|
||||
this.field_217939_i.func_217909_a(sound.func_188721_b()).thenAccept((p_217934_1_) -> {
|
||||
channelmanager$entry.func_217888_a((p_217925_1_) -> {
|
||||
p_217925_1_.func_216429_a(p_217934_1_);
|
||||
p_217925_1_.func_216438_c();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, isound, p_217925_1_));
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@@ -312,6 +318,7 @@
|
||||
channelmanager$entry.func_217888_a((p_217935_1_) -> {
|
||||
p_217935_1_.func_216433_a(p_217928_1_);
|
||||
p_217935_1_.func_216438_c();
|
||||
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, isound, p_217935_1_));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
--- a/net/minecraft/client/audio/SoundHandler.java
|
||||
+++ b/net/minecraft/client/audio/SoundHandler.java
|
||||
@@ -61,6 +61,7 @@
|
||||
SoundHandler.Loader soundhandler$loader = new SoundHandler.Loader();
|
||||
p_212854_2_.func_219894_a();
|
||||
|
||||
+ java.util.List<net.minecraft.util.Tuple<ResourceLocation, Runnable>> resources = new java.util.LinkedList<>();
|
||||
for(String s : p_212854_1_.func_199001_a()) {
|
||||
p_212854_2_.func_76320_a(s);
|
||||
|
||||
@@ -74,7 +75,9 @@
|
||||
p_212854_2_.func_219895_b("register");
|
||||
|
||||
for(Entry<String, SoundList> entry : map.entrySet()) {
|
||||
+ resources.add(new net.minecraft.util.Tuple<>(new ResourceLocation(s, entry.getKey()), () -> {
|
||||
soundhandler$loader.func_217944_a(new ResourceLocation(s, entry.getKey()), entry.getValue(), p_212854_1_);
|
||||
+ }));
|
||||
}
|
||||
|
||||
p_212854_2_.func_76319_b();
|
||||
@@ -91,6 +94,17 @@
|
||||
p_212854_2_.func_76319_b();
|
||||
}
|
||||
|
||||
+ net.minecraftforge.fml.common.progress.StartupProgressManager.start("Loading sounds", resources.size(), bar -> {
|
||||
+ resources.forEach(entry -> {
|
||||
+ bar.step(entry.func_76341_a().toString());
|
||||
+ try {
|
||||
+ entry.func_76340_b().run();
|
||||
+ } catch (RuntimeException e) {
|
||||
+ field_147698_b.warn("Invalid sounds.json", e);
|
||||
+ }
|
||||
+ });
|
||||
+ });
|
||||
+
|
||||
p_212854_2_.func_219897_b();
|
||||
return soundhandler$loader;
|
||||
}
|
||||
@@ -210,6 +224,11 @@
|
||||
this.field_147694_f.func_195855_a(p_195478_1_, p_195478_2_);
|
||||
}
|
||||
|
||||
+ //@Override //TODO: Filtered reload
|
||||
+ public net.minecraftforge.resource.IResourceType getResourceType() {
|
||||
+ return net.minecraftforge.resource.VanillaResourceType.SOUNDS;
|
||||
+ }
|
||||
+
|
||||
public String func_215293_f() {
|
||||
return this.field_147694_f.func_217932_f();
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java
|
||||
+++ b/net/minecraft/client/entity/player/AbstractClientPlayerEntity.java
|
||||
@@ -116,7 +116,7 @@
|
||||
f = 1.0F;
|
||||
}
|
||||
|
||||
- if (this.func_184587_cr() && this.func_184607_cu().func_77973_b() == Items.field_151031_f) {
|
||||
+ if (this.func_184587_cr() && this.func_184607_cu().func_77973_b() instanceof net.minecraft.item.BowItem) {
|
||||
int i = this.func_184612_cw();
|
||||
float f1 = (float)i / 20.0F;
|
||||
if (f1 > 1.0F) {
|
||||
@@ -128,6 +128,6 @@
|
||||
f *= 1.0F - f1 * 0.15F;
|
||||
}
|
||||
|
||||
- return f;
|
||||
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
--- a/net/minecraft/client/entity/player/ClientPlayerEntity.java
|
||||
+++ b/net/minecraft/client/entity/player/ClientPlayerEntity.java
|
||||
@@ -130,6 +130,7 @@
|
||||
}
|
||||
|
||||
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
|
||||
+ net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -449,6 +450,11 @@
|
||||
}
|
||||
|
||||
public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_) {
|
||||
+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_);
|
||||
+ if (event.isCanceled() || event.getSound() == null) return;
|
||||
+ p_184185_1_ = event.getSound();
|
||||
+ p_184185_2_ = event.getVolume();
|
||||
+ p_184185_3_ = event.getPitch();
|
||||
this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false);
|
||||
}
|
||||
|
||||
@@ -591,6 +597,7 @@
|
||||
boolean flag2 = this.func_223110_ee();
|
||||
boolean flag3 = this.func_213287_bg() || this.func_213300_bk();
|
||||
this.field_71158_b.func_217607_a(flag3, this.func_175149_v());
|
||||
+ net.minecraftforge.client.ForgeHooksClient.onInputUpdate(this, this.field_71158_b);
|
||||
this.field_71159_c.func_193032_ao().func_193293_a(this.field_71158_b);
|
||||
if (this.func_184587_cr() && !this.func_184218_aH()) {
|
||||
this.field_71158_b.field_78902_a *= 0.2F;
|
||||
@@ -607,10 +614,14 @@
|
||||
|
||||
if (!this.field_70145_X) {
|
||||
AxisAlignedBB axisalignedbb = this.func_174813_aQ();
|
||||
+ net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent event = new net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent(this, axisalignedbb);
|
||||
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) {
|
||||
+ axisalignedbb = event.getEntityBoundingBox();
|
||||
this.func_213282_i(this.field_70165_t - (double)this.func_213311_cf() * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v + (double)this.func_213311_cf() * 0.35D);
|
||||
this.func_213282_i(this.field_70165_t - (double)this.func_213311_cf() * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v - (double)this.func_213311_cf() * 0.35D);
|
||||
this.func_213282_i(this.field_70165_t + (double)this.func_213311_cf() * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v - (double)this.func_213311_cf() * 0.35D);
|
||||
this.func_213282_i(this.field_70165_t + (double)this.func_213311_cf() * 0.35D, axisalignedbb.field_72338_b + 0.5D, this.field_70161_v + (double)this.func_213311_cf() * 0.35D);
|
||||
+ }
|
||||
}
|
||||
|
||||
boolean flag7 = (float)this.func_71024_bL().func_75116_a() > 6.0F || this.field_71075_bZ.field_75101_c;
|
||||
@@ -950,4 +961,16 @@
|
||||
return this.field_204230_bP;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public void updateSyncFields(ClientPlayerEntity old) {
|
||||
+ this.field_175172_bI = old.field_175172_bI;
|
||||
+ this.field_175166_bJ = old.field_175166_bJ;
|
||||
+ this.field_175167_bK = old.field_175167_bK;
|
||||
+ this.field_175164_bL = old.field_175164_bL;
|
||||
+ this.field_175165_bM = old.field_175165_bM;
|
||||
+ this.field_184841_cd = old.field_184841_cd;
|
||||
+ this.field_175170_bN = old.field_175170_bN;
|
||||
+ this.field_175171_bO = old.field_175171_bO;
|
||||
+ this.field_175168_bP = old.field_175168_bP;
|
||||
+ }
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/client/entity/player/RemoteClientPlayerEntity.java
|
||||
+++ b/net/minecraft/client/entity/player/RemoteClientPlayerEntity.java
|
||||
@@ -28,6 +28,7 @@
|
||||
}
|
||||
|
||||
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
|
||||
+ net.minecraftforge.common.ForgeHooks.onPlayerAttack(this, p_70097_1_, p_70097_2_);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/client/gui/DisplayEffectsScreen.java
|
||||
+++ b/net/minecraft/client/gui/DisplayEffectsScreen.java
|
||||
@@ -84,6 +84,7 @@
|
||||
int i = this.field_147009_r;
|
||||
|
||||
for(EffectInstance effectinstance : p_214077_3_) {
|
||||
+ if (!effectinstance.func_188419_a().shouldRender(effectinstance)) continue;
|
||||
Effect effect = effectinstance.func_188419_a();
|
||||
blit(p_214077_1_ + 6, i + 7, this.blitOffset, 18, 18, potionspriteuploader.func_215288_a(effect));
|
||||
i += p_214077_2_;
|
||||
@@ -95,6 +96,9 @@
|
||||
int i = this.field_147009_r;
|
||||
|
||||
for(EffectInstance effectinstance : p_214078_3_) {
|
||||
+ if (!effectinstance.func_188419_a().shouldRender(effectinstance)) continue;
|
||||
+ effectinstance.func_188419_a().renderInventoryEffect(effectinstance, this, p_214078_1_, i, this.blitOffset);
|
||||
+ if (!effectinstance.func_188419_a().shouldRenderInvText(effectinstance)) { i += p_214078_2_; continue; }
|
||||
String s = I18n.func_135052_a(effectinstance.func_188419_a().func_76393_a());
|
||||
if (effectinstance.func_76458_c() >= 1 && effectinstance.func_76458_c() <= 9) {
|
||||
s = s + ' ' + I18n.func_135052_a("enchantment.level." + (effectinstance.func_76458_c() + 1));
|
||||
@@ -1,21 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiBossOverlay.java
|
||||
+++ b/net/minecraft/client/gui/GuiBossOverlay.java
|
||||
@@ -28,12 +28,17 @@
|
||||
|
||||
for(BossInfoClient bossinfoclient : this.field_184060_g.values()) {
|
||||
int k = i / 2 - 91;
|
||||
+ net.minecraftforge.client.event.RenderGameOverlayEvent.BossInfo event =
|
||||
+ net.minecraftforge.client.ForgeHooksClient.bossBarRenderPre(this.field_184059_f.field_195558_d, bossinfoclient, k, j, 10 + this.field_184059_f.field_71466_p.field_78288_b);
|
||||
+ if (!event.isCanceled()) {
|
||||
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.field_184059_f.func_110434_K().func_110577_a(field_184058_a);
|
||||
this.func_184052_a(k, j, bossinfoclient);
|
||||
String s = bossinfoclient.func_186744_e().func_150254_d();
|
||||
this.field_184059_f.field_71466_p.func_175063_a(s, (float)(i / 2 - this.field_184059_f.field_71466_p.func_78256_a(s) / 2), (float)(j - 9), 16777215);
|
||||
- j += 10 + this.field_184059_f.field_71466_p.field_78288_b;
|
||||
+ }
|
||||
+ j += event.getIncrement();
|
||||
+ net.minecraftforge.client.ForgeHooksClient.bossBarRenderPost(this.field_184059_f.field_195558_d);
|
||||
if (j >= this.field_184059_f.field_195558_d.func_198087_p() / 3) {
|
||||
break;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiButton.java
|
||||
+++ b/net/minecraft/client/gui/GuiButton.java
|
||||
@@ -22,6 +22,7 @@
|
||||
public boolean field_146125_m;
|
||||
protected boolean field_146123_n;
|
||||
private boolean field_194832_o;
|
||||
+ public int packedFGColor; // FML
|
||||
|
||||
public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) {
|
||||
this(p_i1020_1_, p_i1020_2_, p_i1020_3_, 200, 20, p_i1020_4_);
|
||||
@@ -66,6 +67,11 @@
|
||||
this.func_73729_b(this.field_146128_h + this.field_146120_f / 2, this.field_146129_i, 200 - this.field_146120_f / 2, 46 + i * 20, this.field_146120_f / 2, this.field_146121_g);
|
||||
this.func_146119_b(minecraft, p_194828_1_, p_194828_2_);
|
||||
int j = 14737632;
|
||||
+ if (packedFGColor != 0)
|
||||
+ {
|
||||
+ j = packedFGColor;
|
||||
+ }
|
||||
+ else
|
||||
if (!this.field_146124_l) {
|
||||
j = 10526880;
|
||||
} else if (this.field_146123_n) {
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiConnecting.java
|
||||
+++ b/net/minecraft/client/gui/GuiConnecting.java
|
||||
@@ -62,6 +62,7 @@
|
||||
GuiConnecting.this.field_146371_g.func_150719_a(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.field_146297_k, GuiConnecting.this.field_146374_i, (p_209549_1_) -> {
|
||||
GuiConnecting.this.func_209514_a(p_209549_1_);
|
||||
}));
|
||||
+ net.minecraftforge.fml.network.NetworkHooks.registerClientLoginChannel(GuiConnecting.this.field_146371_g);
|
||||
GuiConnecting.this.field_146371_g.func_179290_a(new CPacketHandshake(p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN));
|
||||
GuiConnecting.this.field_146371_g.func_179290_a(new CPacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e()));
|
||||
} catch (UnknownHostException unknownhostexception) {
|
||||
@@ -1,16 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiIngame.java
|
||||
+++ b/net/minecraft/client/gui/GuiIngame.java
|
||||
@@ -548,7 +548,13 @@
|
||||
GlStateManager.func_179094_E();
|
||||
GlStateManager.func_179147_l();
|
||||
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
+ FontRenderer font = field_92016_l.func_77973_b().getFontRenderer(field_92016_l);
|
||||
+ if (font == null) {
|
||||
this.func_175179_f().func_175063_a(s, (float)i, (float)j, 16777215 + (k << 24));
|
||||
+ } else {
|
||||
+ i = (this.field_194811_H - font.func_78256_a(s)) / 2;
|
||||
+ font.func_175063_a(s, (float)i, (float)j, 16777215 + (k << 24));
|
||||
+ }
|
||||
GlStateManager.func_179084_k();
|
||||
GlStateManager.func_179121_F();
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiKeyBindingList.java
|
||||
+++ b/net/minecraft/client/gui/GuiKeyBindingList.java
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
protected int func_148137_d() {
|
||||
- return super.func_148137_d() + 15;
|
||||
+ return super.func_148137_d() + 35;
|
||||
}
|
||||
|
||||
public int func_148139_c() {
|
||||
@@ -77,13 +77,14 @@
|
||||
private KeyEntry(final KeyBinding p_i45029_2_) {
|
||||
this.field_148282_b = p_i45029_2_;
|
||||
this.field_148283_c = I18n.func_135052_a(p_i45029_2_.func_151464_g());
|
||||
- this.field_148280_d = new GuiButton(0, 0, 0, 75, 20, I18n.func_135052_a(p_i45029_2_.func_151464_g())) {
|
||||
+ this.field_148280_d = new GuiButton(0, 0, 0, 95, 20, I18n.func_135052_a(p_i45029_2_.func_197978_k())) {
|
||||
public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
GuiKeyBindingList.this.field_148191_k.field_146491_f = p_i45029_2_;
|
||||
}
|
||||
};
|
||||
this.field_148281_e = new GuiButton(0, 0, 0, 50, 20, I18n.func_135052_a("controls.reset")) {
|
||||
public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
+ field_148282_b.setToDefault();
|
||||
GuiKeyBindingList.this.field_148189_l.field_71474_y.func_198014_a(p_i45029_2_, p_i45029_2_.func_197977_i());
|
||||
KeyBinding.func_74508_b();
|
||||
}
|
||||
@@ -95,7 +96,7 @@
|
||||
int j = this.func_195002_d();
|
||||
boolean flag = GuiKeyBindingList.this.field_148191_k.field_146491_f == this.field_148282_b;
|
||||
GuiKeyBindingList.this.field_148189_l.field_71466_p.func_211126_b(this.field_148283_c, (float)(j + 90 - GuiKeyBindingList.this.field_148188_n), (float)(i + p_194999_2_ / 2 - GuiKeyBindingList.this.field_148189_l.field_71466_p.field_78288_b / 2), 16777215);
|
||||
- this.field_148281_e.field_146128_h = j + 190;
|
||||
+ this.field_148281_e.field_146128_h = j + 210;
|
||||
this.field_148281_e.field_146129_i = i;
|
||||
this.field_148281_e.field_146124_l = !this.field_148282_b.func_197985_l();
|
||||
this.field_148281_e.func_194828_a(p_194999_3_, p_194999_4_, p_194999_6_);
|
||||
@@ -103,11 +104,12 @@
|
||||
this.field_148280_d.field_146129_i = i;
|
||||
this.field_148280_d.field_146126_j = this.field_148282_b.func_197978_k();
|
||||
boolean flag1 = false;
|
||||
+ boolean keyCodeModifierConflict = true; // less severe form of conflict, like SHIFT conflicting with SHIFT+G
|
||||
if (!this.field_148282_b.func_197986_j()) {
|
||||
for(KeyBinding keybinding : GuiKeyBindingList.this.field_148189_l.field_71474_y.field_74324_K) {
|
||||
if (keybinding != this.field_148282_b && this.field_148282_b.func_197983_b(keybinding)) {
|
||||
flag1 = true;
|
||||
- break;
|
||||
+ keyCodeModifierConflict &= keybinding.hasKeyCodeModifierConflict(this.field_148282_b);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +117,7 @@
|
||||
if (flag) {
|
||||
this.field_148280_d.field_146126_j = TextFormatting.WHITE + "> " + TextFormatting.YELLOW + this.field_148280_d.field_146126_j + TextFormatting.WHITE + " <";
|
||||
} else if (flag1) {
|
||||
- this.field_148280_d.field_146126_j = TextFormatting.RED + this.field_148280_d.field_146126_j;
|
||||
+ this.field_148280_d.field_146126_j = (keyCodeModifierConflict ? TextFormatting.GOLD : TextFormatting.RED) + this.field_148280_d.field_146126_j;
|
||||
}
|
||||
|
||||
this.field_148280_d.func_194828_a(p_194999_3_, p_194999_4_, p_194999_6_);
|
||||
@@ -1,43 +0,0 @@
|
||||
--- a/net/minecraft/client/gui/GuiMainMenu.java
|
||||
+++ b/net/minecraft/client/gui/GuiMainMenu.java
|
||||
@@ -192,12 +192,18 @@
|
||||
GuiMainMenu.this.field_146297_k.func_147108_a(new GuiMultiplayer(GuiMainMenu.this));
|
||||
}
|
||||
});
|
||||
- this.func_189646_b(new GuiButton(14, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135052_a("menu.online")) {
|
||||
+ this.func_189646_b(new GuiButton(14, this.field_146294_l / 2 + 2, p_73969_1_ + p_73969_2_ * 2, 98, 20, I18n.func_135052_a("menu.online")) {
|
||||
public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
GuiMainMenu.this.func_140005_i();
|
||||
}
|
||||
});
|
||||
+ this.func_189646_b(new GuiButton(6, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, 98, 20, I18n.func_135052_a("fml.menu.mods")) {
|
||||
+ @Override
|
||||
+ public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
+ GuiMainMenu.this.field_146297_k.func_147108_a(new net.minecraftforge.fml.client.gui.GuiModList(GuiMainMenu.this));
|
||||
}
|
||||
+ });
|
||||
+ }
|
||||
|
||||
private void func_73972_b(int p_73972_1_, int p_73972_2_) {
|
||||
this.func_189646_b(new GuiButton(11, this.field_146294_l / 2 - 100, p_73972_1_, I18n.func_135052_a("menu.playdemo")) {
|
||||
@@ -206,7 +212,7 @@
|
||||
}
|
||||
});
|
||||
this.field_73973_d = this.func_189646_b(new GuiButton(12, this.field_146294_l / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.func_135052_a("menu.resetdemo")) {
|
||||
- public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||
+ public void func_194829_a(double mouseX, double mouseY) {
|
||||
ISaveFormat isaveformat1 = GuiMainMenu.this.field_146297_k.func_71359_d();
|
||||
WorldInfo worldinfo1 = isaveformat1.func_75803_c("Demo_World");
|
||||
if (worldinfo1 != null) {
|
||||
@@ -283,7 +289,10 @@
|
||||
s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d());
|
||||
}
|
||||
|
||||
- this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1);
|
||||
+ net.minecraftforge.fml.BrandingControl.forEachLine(true, true, (brdline, brd) ->
|
||||
+ this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + brdline * (this.field_146289_q.field_78288_b + 1)), 16777215)
|
||||
+ );
|
||||
+
|
||||
this.func_73731_b(this.field_146289_q, "Copyright Mojang AB. Do not distribute!", this.field_193979_N, this.field_146295_m - 10, -1);
|
||||
if (p_73863_1_ > this.field_193979_N && p_73863_1_ < this.field_193979_N + this.field_193978_M && p_73863_2_ > this.field_146295_m - 10 && p_73863_2_ < this.field_146295_m) {
|
||||
func_73734_a(this.field_193979_N, this.field_146295_m - 1, this.field_193979_N + this.field_193978_M, this.field_146295_m, -1);
|
||||
@@ -0,0 +1,40 @@
|
||||
--- a/net/minecraft/client/gui/IngameGui.java
|
||||
+++ b/net/minecraft/client/gui/IngameGui.java
|
||||
@@ -408,6 +408,9 @@
|
||||
|
||||
for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
|
||||
Effect effect = effectinstance.func_188419_a();
|
||||
+ if (!effect.shouldRenderHUD(effectinstance)) continue;
|
||||
+ // Rebind in case previous renderHUDEffect changed texture
|
||||
+ this.field_73839_d.func_110434_K().func_110577_a(ContainerScreen.field_147001_a);
|
||||
if (effectinstance.func_205348_f()) {
|
||||
int k = this.field_194811_H;
|
||||
int l = 1;
|
||||
@@ -439,11 +442,13 @@
|
||||
float f_f = f;
|
||||
int k_f = k;
|
||||
int l_f = l;
|
||||
+
|
||||
TextureAtlasSprite textureatlassprite = potionspriteuploader.func_215288_a(effect);
|
||||
list.add(() -> {
|
||||
GlStateManager.color4f(1.0F, 1.0F, 1.0F, f_f);
|
||||
blit(k_f + 3, l_f + 3, this.blitOffset, 18, 18, textureatlassprite);
|
||||
});
|
||||
+ effect.renderHUDEffect(effectinstance, this, k, l, this.blitOffset, f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,7 +593,13 @@
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||
fill(i - 2, j - 2, i + this.func_175179_f().func_78256_a(s) + 2, j + 9 + 2, this.field_73839_d.field_71474_y.func_216839_a(0));
|
||||
+ FontRenderer font = field_92016_l.func_77973_b().getFontRenderer(field_92016_l);
|
||||
+ if (font == null) {
|
||||
this.func_175179_f().func_175063_a(s, (float)i, (float)j, 16777215 + (k << 24));
|
||||
+ } else {
|
||||
+ i = (this.field_194811_H - font.func_78256_a(s)) / 2;
|
||||
+ font.func_175063_a(s, (float)i, (float)j, 16777215 + (k << 24));
|
||||
+ }
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
Loaded 100 of 1464 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user