Compare commits

...
113 Commits
Author SHA1 Message Date
SizableShrimp a1eb26aee2 [1.13.x] Update Installer to 2.1.+ (#8288)
* Update Installer to 2.1.+

Signed-off-by: SizableShrimp <[email protected]>

* Update references of files.mcf.net/maven to maven.mcf.net

Signed-off-by: SizableShrimp <[email protected]>
2021-12-12 03:33:15 +10:30
Marc Hermans 638bea3b9c Patch the jenkinsfile so it publishes using the correct credentials provided by Jenkins. (#8276) 2021-12-11 00:23:30 +10:30
Marc Hermans 05cb868bb2 [CVE-2021-44228]: Update Log4J to fix the security issue inside it. (#8273) 2021-12-10 22:56:02 +10:30
Ben Staddon 54d0bafa12 Pass tick counter to custom render handlers (#5744) 2019-07-08 19:46:50 -07:00
LexManos d3e8804dbf Include new library in installer json.
Change order of versions on main menu, to prevent overlap with default window size.
Fix Forge update not displaying version info.
2019-05-27 19:13:55 -07:00
LexManos c509cac02b Fix vanilla structures loosing valid flags, And fix error placement for unsaveable structures. 2019-05-27 13:49:15 -07:00
LexManos 4b5bf760ec Fix tall grass not dropping seeds. Closes #5675 2019-05-27 13:46:19 -07:00
cpw c57c6213ea Enhance crash reports and logging to capture transformers on stack trace elements.
Moved log4j2.xml file to the launcher source set, so it loads first in the client.

Signed-off-by: cpw <[email protected]>
2019-05-27 00:00:45 -04:00
tterrag fb30820e2b Remove cache eviction for model data, optimize 2019-05-23 21:49:39 -04:00
Philipp 61b612c88a dimesnion -> dimension typos (#5684) 2019-05-21 15:43:45 -04:00
ben-mkiv d3edc9dcdc FENCES_NETHER_BRRICK => FENCES_NETHER_BRICK (#5681) 2019-05-21 15:43:45 -04:00
Hugman ba2485b807 GEMS_QUARRTZ -> GEMS_QUARTZ (#5635) 2019-05-21 15:43:45 -04:00
Cadiboo 60c6635af5 Small comment typo fixes for ObfuscationReflectionHelper (#5583) 2019-05-21 15:43:45 -04:00
James Mitchell 9c5134fb6b Fix MC-146650 GuiContainer#keyPressed to return the correct key handled boolean (#5367) 2019-05-21 11:00:47 -07:00
LexManos eae0858de6 Fix build script producing duplicated eclipse source folders.
Fix not including userdev source in sources jar.
Update license header of files that need it.
Delete patches_old folders. Most are unneeded in 1.13+ as the systems they effected were changed significantly. Any that need to be readdressed can be done as PRs.
2019-05-13 19:11:24 -07:00
Vincent Lee d7949d5316 Fix caps not being visible on old player during clone event (#5728) 2019-05-13 09:57:50 -07:00
LexManos 8c44d6d4cb Fix vanilla bug in writing structure templates with multiple palettes. 2019-05-12 23:40:54 -07:00
Vincent Lee 049fae5c65 Add support for vanilla recipes having nbt on result (#5710) Fix #5663 2019-05-12 21:44:46 -07:00
tterrag 41f8459a41 Fix modded TEs not being removed on block change 2019-05-12 15:05:33 -04:00
cpw 5cd82f16f2 Fix #5735 by pushing new build. Shutdown Forge eventbus when errors occur. Closes #5711
Also, improve logging so warnings, errors and fatals are always shown, regardless of marker.

Signed-off-by: cpw <[email protected]>
2019-05-12 13:07:29 -04:00
OhYea777 444ba7a7d5 Update 'build.gradle' to fix run configs for launching forge 2019-05-12 12:51:18 -04:00
tterrag dcd5f1d711 Remove patch causing TEs to be removed on state change 2019-05-11 23:30:46 -04:00
tterrag 18ce494cba Fix default IUnbakedModel bake method using wrong format 2019-05-11 23:22:46 -04:00
tterrag 9e39570d49 Add ModelDataTest to test mods.toml 2019-05-11 23:22:24 -04:00
cpw 6a1337aa92 Updated a couple of libraries. Fixed bug where modid could be in toml but
not found during loading, yet game continued to load.

Signed-off-by: cpw <[email protected]>
2019-05-11 20:47:42 -04:00
tterrag 605c4a0adf Add test mods run configs 2019-05-11 18:58:45 -04:00
tterrag 7c90d9f3e8 Better handle errors from eclipse compiled (non-compiling) bytecode 2019-05-11 18:58:45 -04:00
tterrag 01a0674490 Finish model loader debug mod 2019-05-11 18:58:45 -04:00
tterrag e482793f69 Comment out test Mod/EventBusSubscriber annotations, fix up ModelLoaderRegistryTest 2019-05-11 18:58:45 -04:00
tterrag de14670d4d Fix BakedQuadRetextured calling old BakedQuad ctor 2019-05-11 16:36:16 -04:00
tterrag 9209c3cbfe Add new system for model data, replacing extended states (#5564) 2019-05-09 02:10:38 -04:00
LexManos a7204b5cd3 Bump ForgeSPI version, and add support for DistCleaner stripping interfaces from classes.
Add more detail to VersionChecker log info.
2019-05-06 15:52:12 -07:00
tterrag 616416569b Add explicit return type checks for extensible enums, fix exc 2019-04-25 19:51:20 -04:00
tterrag cab1b9716c Fix EnumRarity, make sure extensible enums have at least one factory candidate 2019-04-25 19:38:03 -04:00
tterrag bda3f1b7c6 Make EnumRarity extensible 2019-04-25 19:29:19 -04:00
tterrag 416bf9e3bf Allow loading json constants outside of _constants 2019-04-25 19:22:43 -04:00
tterrag 102e0095a7 Update skipped_commits.md 2019-04-25 18:32:06 -04:00
Ben Staddon 1fcfd54584 Fix some vertex format changes not being handled correctly (#5368) 2019-04-25 18:31:17 -04:00
Ben Staddon 441a9c9024 Transform vertex normals as well as positions when generating quads (#5242) 2019-04-25 18:29:12 -04:00
Robert WC Seifert f68fdcf703 Fix for SidedInvWrapper isItemValid using wrong slot (#5642) 2019-04-25 18:20:42 -04:00
tterrag d8137f7bcf Add comment to vanilla bugfix, update skipped_commits.md 2019-04-25 15:59:08 -04:00
tterrag 42c27b8845 Change default username to 'Dev', add ability to replace '#' with randomized numbers 2019-04-25 15:52:02 -04:00
tterrag 8408539f1c Fix MC-128441: cross-dimensional teleporting does not work 2019-04-25 15:18:40 -04:00
Ben Staddon 1f0467b864 Add Forge dimension-changing hooks to spectator handling code (#5212) 2019-04-25 15:08:15 -04:00
ichttt 1aae18d4bc Minor performace improvement when building chunks and rendering blocks (#5286) 2019-04-24 13:20:19 -04:00
Ben Staddon 45902676fd Catch json parsing errors from constants/factories files (#5258) 2019-04-24 13:12:03 -04:00
Ben Staddon 931105123e Allow custom DataSerializers to be registered safely (#5245) 2019-04-24 13:05:12 -04:00
tterrag cf35019d07 Further clean up Constants, and add two new BlockFlags 2019-04-24 12:58:09 -04:00
tterrag c636f6edd6 Remove unnecessary patch 2019-04-24 02:13:17 -04:00
tterrag 58b28569e2 Update skipped_commits.md 2019-04-24 01:34:43 -04:00
Pokechu22 73bb013b25 Fail fast when null is used with setTag instead of crashing in writeEntry (#5257) 2019-04-24 01:32:45 -04:00
tterrag d6da893c0c Update Constants for 1.13 2019-04-24 01:26:24 -04:00
Wyn Price 47a7d8e2b7 Added more Constants (#5323) 2019-04-24 01:25:21 -04:00
Thanh-Phuong cb0cf2f04f Add a few events pertaining to villages (#5302) 2019-04-24 01:07:02 -04:00
tterrag a4cf5951ca Sync up canPlaceTorchOnTop logic with BlockTorch#isValidPosition 2019-04-24 00:59:03 -04:00
tterrag 822dce47cd Update skipped_commits.md 2019-04-23 21:12:22 -04:00
Tyler Hancockandtterrag 2ea475ad31 Fix special spawn event not firing in many cases. (#5389)
Co-authored-by: tterrag <[email protected]>
2019-04-23 21:10:37 -04:00
Ben Staddon eed92ba07c Only prompt for missing registries on local worlds (#5348) 2019-04-23 20:45:48 -04:00
tterrag a86317efc8 Reimplement ForgeHooks#onPlaceItemIntoWorld and remove old place events 2019-04-23 20:42:08 -04:00
Christopher Krierandtterrag ca973f053f Add EntityPlaceEvent (#5057)
Co-authored-by: tterrag <[email protected]>
2019-04-23 19:58:09 -04:00
Ben Staddon 119e4a6924 Fix small logic error in ItemTextureQuadConverter (#5463) 2019-04-23 19:03:43 -04:00
Ben Staddon aef224221f Better support for custom bows (#5209) 2019-04-23 18:04:19 -04:00
Ben Staddon 18d0f7ba0d Fix up torch placement logic to handle more vanilla special-casing (#5426) 2019-04-23 17:39:50 -04:00
tterrag dd9077d52d Update skipped_commits.md 2019-04-23 16:51:11 -04:00
LexManos 01cb2117cc Written size does not include int bytes. 2019-04-23 16:30:26 -04:00
LexManos 574f890e58 Extend Region files to support >1MB per chunk.
If the 'sector count' is 255, ask the compressed data header for the proper length.
2019-04-23 16:27:34 -04:00
tterrag e70cc4fcae Simplify custom item rendering by removing GL emissivity hacks 2019-04-23 15:23:12 -04:00
tterrag d02da21a7a Support diffuse lighting flag in item rendering 2019-04-23 15:21:01 -04:00
Ben Staddon 817546e4c8 Add a hook to allow continuously using items through stack changes (#4834) 2019-04-23 15:12:55 -04:00
tterrag 1a7e05a3da Update skipped_commits.md 2019-04-23 14:48:47 -04:00
Ben Staddon f19fed0853 Add redirects to PotionEffect to respect registry replacement (#5213) 2019-04-23 14:47:47 -04:00
tterrag 06f67f7696 Add FieldRedirectTransformer updated to new modlauncher API 2019-04-23 14:39:26 -04:00
Ben Staddon 501f1dc8dc Fix small logic error in emissive item rendering code (#5320) 2019-04-23 12:37:32 -04:00
Ben Staddon 8b5a5ecd74 Ensure slave maps are cleaned up when handling registry overrides (#5250) 2019-04-23 12:31:55 -04:00
tterrag cb3ff19801 Remove hack to force enum configs to strings 2019-04-18 22:13:19 -04:00
tterrag f30d7bc845 Fix #5688 config values are unordered, update Night-Config 2019-04-18 22:13:13 -04:00
ichttt c0aa4c8517 Cleanup/Implement some todos (#5660) 2019-04-17 13:57:32 -07:00
ichttt e868739675 Readd redirecting of stdout and stderr (#5678) 2019-04-16 14:08:08 -07:00
Vincent Lee 991682956d Fix some typos in spawn dimension patches (#5669) 2019-04-15 19:04:24 -07:00
DaemonUmbra e168d8e593 Remove Vanilla Logging Config (#5618)
This will re-enable Forge's logging configuration in "production"
2019-04-15 19:00:11 -07:00
Lars Gerrits 273b1b110a Add GuiContainerEvent.DrawBackground event. (#5595) 2019-04-15 18:56:58 -07:00
0uti bbc92fa51c [1.13.x] Fire InputEvents (#5533) 2019-04-15 18:50:18 -07:00
tterrag 8515b9dd10 Fix compile error in FakePlayer from cherry pick 2019-04-13 21:42:42 -04:00
tterrag a56f894e39 Update skipped_commits.md 2019-04-13 11:18:54 -04:00
LexManos 592b957b77 Fix potential issues with the Minecraft FakePlayer lingering around after world unloads. 2019-04-13 11:17:27 -04:00
tterrag 65cfef1b2e Fix potion remove event not always firing, add expiry event 2019-04-13 11:17:00 -04:00
mcenderdragon 914fe91db5 added PotionHooks, closes #3867, #4375 (#4614) 2019-04-13 11:03:58 -04:00
tterrag 0c19ccc11a Fix EntityDataManager logging level 2019-04-13 10:45:33 -04:00
tterrag 3560e47a77 Fix some typos in cherry-picked commits 2019-04-13 09:47:33 -04:00
tterrag c33cd678f0 Update skipped_commits.md 2019-04-12 20:18:17 -04:00
ichttt a67cce2f91 Add a hook for farmland watering (#4891) 2019-04-12 20:16:34 -04:00
ichttt 72bc39d831 Add logging for data manager key registration errors (#5129) 2019-04-12 20:01:00 -04:00
tterrag abf010ac48 Fix #5659 setdimension command entity filtering, avoid inverting logic 2019-04-12 19:43:41 -04:00
Ben Staddonandtterrag 2baa05ace9 Improve support for custom block path types (#5203)
Co-authored-by: tterrag <[email protected]>
2019-04-12 13:47:48 -04:00
Ben Staddon fa708f93ee Allow items to control the rate of repair from mending (#5102) 2019-04-12 13:26:15 -04:00
tterrag a0a3f9dbfb Update skipped_commits.md 2019-04-12 11:15:31 -04:00
Ben Staddon bda875166a Improve exception handling from server starting events (#5226) 2019-04-12 11:12:15 -04:00
Ben Staddon e376172312 Improve context provided by potion icon rendering hooks (#5111) 2019-04-12 11:05:34 -04:00
MrRiegel d20b1f271e Fix an ObjectHolderRef internal error message (#5214) 2019-04-12 10:49:26 -04:00
tterrag 67da3182c1 Implement rendering for item models with emissive quads (#5047) 2019-04-12 10:45:32 -04:00
Paul Fulham 1280dea111 Fix inaccurate main thread name shown in client log (#5078) 2019-04-12 10:23:08 -04:00
Ben Staddon 3920b7aaa3 Fix Baked Item models with transformations (#5241) 2019-04-12 10:11:15 -04:00
tterrag 52890edfac Update skipped_commits.md 2019-04-11 19:31:04 -04:00
Vincent Lee ed3aea0980 Stop firing LivingSetAttackTargetEvent for setRevengeTarget (#5217) 2019-04-11 19:01:52 -04:00
Ben Staddon 3f70fd49ff Fix missing string parameters in some log messages (#5210) 2019-04-11 18:57:37 -04:00
Ben Staddon 7496e3dbdf Re-add some missing villager profession patches (#5200)
* Fix zombie villagers only spawning with vanilla professions
* Fix spawning modded villagers that do not have their own building
2019-04-11 18:50:01 -04:00
TheIllusiveC4 7c401e9a35 Fix the bed position given to the SleepingTimeCheck event (#5107) 2019-04-11 18:09:01 -04:00
Ben Staddon a02bec7ebe Fix some null returns from defaulted registries (#5235) 2019-04-11 18:05:26 -04:00
Yanbing Zhao 254c1d1531 Only remove synthetic lambda methods referenced in body of SideOnly methods (#5127) 2019-04-11 18:02:34 -04:00
tterrag 971de3e1d0 Update skipped_commits.md 2019-04-11 17:47:13 -04:00
gaudus 7d2c8fa6ef fixed visual bug with guislider 2019-04-11 17:38:01 -04:00
Ben Staddon ac210a3201 Make Forge blockstate variants correctly inherit AO setting from vanilla models (#5190) 2019-04-11 17:35:01 -04:00
Ben Staddon a79975b3ea Make Forge-provided default transforms accessible to custom models 2019-04-11 17:32:31 -04:00
353 changed files with 5709 additions and 3882 deletions

No files matched your search

Vendored
+13 -20
View File
@@ -6,8 +6,8 @@ pipeline {
}
agent {
docker {
image 'gradlewrapper:latest'
args '-v gradlecache:/gradlecache'
image 'gradle:jdk8'
args '-v forgegc:/home/gradle/.gradle/'
}
}
environment {
@@ -18,11 +18,6 @@ pipeline {
}
stages {
stage('fetch') {
steps {
checkout scm
}
}
stage('notify_start') {
when {
not {
@@ -64,20 +59,22 @@ pipeline {
}
}
environment {
FORGE_MAVEN = credentials('forge-maven-forge-user')
CROWDIN = credentials('forge-crowdin')
KEYSTORE = credentials('forge-jenkins-keystore-old')
KEYSTORE_KEYPASS = credentials('forge-jenkins-keystore-old-keypass')
KEYSTORE_STOREPASS = credentials('forge-jenkins-keystore-old-keypass')
}
steps {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
]){
sh './gradlew ${GRADLE_ARGS} :forge:publish -PforgeMavenUser=${FORGE_MAVEN_USR} -PforgeMavenPassword=${FORGE_MAVEN_PSW} -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
withCredentials([usernamePassword(credentialsId: 'maven-forge-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
withGradle {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PkeystoreKeyPass=${KEYSTORE_KEYPASS} -PkeystoreStorePass=${KEYSTORE_STOREPASS} -Pkeystore=${KEYSTORE} -PcrowdinKey=${CROWDIN}'
}
}
}
post {
success {
build job: 'filegenerator', parameters: [string(name: 'COMMAND', value: "promote net.minecraftforge:forge ${env.MYVERSION} latest")], propagate: false, wait: false
}
//We're not testing anymore so don't use the test group
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
@@ -88,9 +85,7 @@ pipeline {
CROWDIN = credentials('forge-crowdin')
}
steps {
cache(maxCacheSize: 250/*MB*/, caches: [
[$class: 'ArbitraryFileCache', excludes: '', includes: 'output.txt', path: '${WORKSPACE}/projects/forge/build/extractRangeMap/'] //Cache the rangemap to help speed up builds
]){
withGradle {
sh './gradlew ${GRADLE_ARGS} :forge:publish -PcrowdinKey=${CROWDIN}'
}
}
@@ -100,9 +95,7 @@ pipeline {
always {
script {
archiveArtifacts artifacts: 'projects/forge/build/libs/**/*.*', fingerprint: true, onlyIfSuccessful: true, allowEmptyArchive: true
//junit 'build/test-results/*/*.xml'
//jacoco sourcePattern: '**/src/*/java'
if (env.CHANGE_ID == null) { // This is unset for non-PRs
discordSend(
title: "${DISCORD_PREFIX} Finished ${currentBuild.currentResult}",
+75 -40
View File
@@ -1,8 +1,7 @@
buildscript {
repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -23,6 +22,7 @@ import net.minecraftforge.gradle.patcher.task.ApplyBinPatches
import org.apache.tools.ant.filters.ReplaceTokens
import de.undercouch.gradle.tasks.download.Download
import net.minecraftforge.gradle.patcher.task.TaskReobfuscateJar
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import java.util.stream.Collectors
@@ -106,49 +106,54 @@ project(':forge') {
apply plugin: 'de.undercouch.download'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
group = 'net.minecraftforge' //TODO: remove test when we finish patches and want users to find it
group = 'net.minecraftforge'
sourceSets {
fmllauncher {
java {
srcDir "$rootDir/src/fmllauncher/java"
srcDirs = ["$rootDir/src/fmllauncher/java"]
}
resources {
srcDir "$rootDir/src/fmllauncher/resources"
srcDirs = ["$rootDir/src/fmllauncher/resources"]
}
}
main {
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
java {
srcDir "$rootDir/src/main/java"
srcDirs = ["$rootDir/src/main/java"]
}
resources {
srcDir "$rootDir/src/main/resources"
srcDirs = ["$rootDir/src/main/resources"]
}
}
test {
compileClasspath += sourceSets.fmllauncher.runtimeClasspath
runtimeClasspath += sourceSets.fmllauncher.runtimeClasspath
java {
// srcDir "$rootDir/src/test/java" TODO fix later
srcDir "$rootDir/src/fmllaunchertest/java"
srcDirs = [
"$rootDir/src/test/java",
"$rootDir/src/fmllaunchertest/java"
]
}
resources {
srcDir "$rootDir/src/test/resources"
srcDirs = ["$rootDir/src/test/resources"]
}
}
userdev {
compileClasspath += sourceSets.main.runtimeClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
java {
srcDir "$rootDir/src/userdev/java"
srcDirs = ["$rootDir/src/userdev/java"]
}
resources {
srcDir "$rootDir/src/userdev/resources"
srcDirs = ["$rootDir/src/userdev/resources"]
}
}
}
//Eclipse adds the sourcesets twice, once where we tell it to, once in the projects folder. No idea why. So delete them
eclipse.classpath.file.whenMerged { cls -> cls.entries.removeIf { e -> e instanceof SourceFolder && e.path.startsWith('src/') && !e.path.startsWith('src/main/') } }
repositories {
mavenLocal()
mavenCentral()
@@ -208,6 +213,22 @@ project(':forge') {
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 {
@@ -224,6 +245,22 @@ project(':forge') {
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 }
}
}
}
}
@@ -288,20 +325,22 @@ project(':forge') {
installer 'org.ow2.asm:asm:6.2'
installer 'org.ow2.asm:asm-commons:6.2'
installer 'org.ow2.asm:asm-tree:6.2'
installer 'cpw.mods:modlauncher:1.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.8.+:service'
installer 'net.minecraftforge:forgespi:0.11.+'
installer 'net.minecraftforge:coremods:0.4.+'
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.5.0'
installer 'com.electronwill.night-config:toml:3.5.0'
installer 'com.electronwill.night-config:core:3.6.0'
installer 'com.electronwill.night-config:toml:3.6.0'
installer 'org.jline:jline:3.9.0'
installer 'org.apache.maven:maven-artifact:3.6.0'
installer 'net.jodah:typetools:0.6.0'
installer 'java3d:vecmath:1.5.2'
installer 'org.apache.logging.log4j:log4j-api:2.11.1'
installer 'org.apache.logging.log4j:log4j-core:2.11.1'
installer 'org.apache.logging.log4j:log4j-api:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-core:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' //TODO: Unpin in 1.18.1 or when Mojang bumps the Log4J version
installer 'net.minecrell:terminalconsoleappender:1.1.+'
installer 'net.sf.jopt-simple:jopt-simple:5.0.4'
fmllauncherImplementation 'com.google.guava:guava:21.0'
@@ -450,18 +489,7 @@ project(':forge') {
type: 'release',
mainClass: 'cpw.mods.modlauncher.Launcher',
inheritsFrom: MC_VERSION,
logging: [
client: [
argument: '-Dlog4j.configurationFile=${path}',
file: [
id:'client-1.12.xml',
sha1:'ef4f57b922df243d0cef096efe808c72db042149',
size:877,
url:'https://launcher.mojang.com/v1/objects/ef4f57b922df243d0cef096efe808c72db042149/client-1.12.xml'
],
type: 'log4j2-xml'
]
],
logging: {},
arguments: [
game: ['--launchTarget', 'fmlclient', '--fml.forgeVersion', "${project.version.substring(MC_VERSION.length() + 1)}", '--fml.mcVersion', "${MC_VERSION}", '--fml.forgeGroup', "${project.group}", '--fml.mcpVersion', "${MCP_VERSION}"]
],
@@ -704,7 +732,7 @@ project(':forge') {
}
task downloadInstaller(type: DownloadMavenArtifact) {
artifact = 'net.minecraftforge:installer:2.0.+:shrunk'
artifact = 'net.minecraftforge:installer:2.1.+:shrunk'
changing = true
}
@@ -867,8 +895,12 @@ project(':forge') {
}
}
extractRangeMap {
addDependencies jar.archivePath
addSources sourceSets.userdev.java.srcDirs
}
applyRangeMap {
setSources sourceSets.userdev.java.srcDirs.findAll({f -> (f != patcher.patchedSrc) })
setSources sourceSets.userdev.java.srcDirs
}
tasks.eclipse.dependsOn('genEclipseRuns')
@@ -917,12 +949,15 @@ project(':forge') {
}
repositories {
maven {
if (project.hasProperty('forgeMavenPassword')) {
credentials {
username project.properties.forgeMavenUser
password project.properties.forgeMavenPassword
if (System.env.MAVEN_USER) {
url "https://maven.minecraftforge.net/releases/"
authentication {
basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER ?: 'not'
password = System.env.MAVEN_PASSWORD ?: 'set'
}
url 'https://files.minecraftforge.net/maven/manage/upload'
} else {
url 'file://' + rootProject.file('repo').getAbsolutePath()
}
@@ -975,7 +1010,7 @@ def getArtifacts(project, config, classifiers) {
def path = "${folder}${filename}"
def url = "https://libraries.minecraft.net/${path}"
if (!checkExists(url)) {
url = "https://files.minecraftforge.net/maven/${path}"
url = "https://maven.minecraftforge.net/${path}"
}
//TODO remove when Mojang launcher is updated
if (!classifiers && art.classifier != null) { //Mojang launcher doesn't currently support classifiers, so... move it to part of the version, and force the extension to 'jar'
+1 -2
View File
@@ -1,7 +1,6 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
dependencies {
@@ -47,12 +47,17 @@
} else {
return i;
}
@@ -468,8 +470,12 @@
@@ -468,8 +470,17 @@
@Deprecated
public void func_196243_a(IBlockState p_196243_1_, World p_196243_2_, BlockPos p_196243_3_, IBlockState p_196243_4_, boolean p_196243_5_) {
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer)) {
+ p_196243_2_.func_175713_t(p_196243_3_);
+ // FORGE: Remove modded TEs when the block changes
+ if (hasTileEntity(p_196243_1_) && !(this instanceof BlockContainer // Vanilla ITEP classes, they do this themselves
+ || this instanceof net.minecraft.block.BlockBed
+ || this instanceof net.minecraft.block.BlockRedstoneDiode)) {
+ if (p_196243_1_.func_177230_c() != p_196243_4_.func_177230_c()) {
+ p_196243_2_.func_175713_t(p_196243_3_);
+ }
+ }
}
@@ -60,7 +65,7 @@
public int func_196264_a(IBlockState p_196264_1_, Random p_196264_2_) {
return 1;
}
@@ -484,30 +490,30 @@
@@ -484,30 +495,30 @@
if (f == -1.0F) {
return 0.0F;
} else {
@@ -105,7 +110,7 @@
float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * 0.5F) + 0.25D;
@@ -529,6 +535,7 @@
@@ -529,6 +540,7 @@
}
@@ -113,7 +118,7 @@
public float func_149638_a() {
return this.field_149781_w;
}
@@ -543,7 +550,7 @@
@@ -543,7 +555,7 @@
}
}
@@ -122,7 +127,7 @@
}
public void func_180652_a(World p_180652_1_, BlockPos p_180652_2_, Explosion p_180652_3_) {
@@ -597,16 +604,22 @@
@@ -597,16 +609,22 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, @Nullable TileEntity p_180657_5_, ItemStack p_180657_6_) {
p_180657_2_.func_71029_a(StatList.field_188065_ae.func_199076_b(this));
p_180657_2_.func_71020_j(0.005F);
@@ -147,7 +152,7 @@
protected boolean func_149700_E() {
return this.func_176223_P().func_185917_h() && !this.func_149716_u();
}
@@ -663,6 +676,7 @@
@@ -663,6 +681,7 @@
p_176216_2_.field_70181_x = 0.0D;
}
@@ -155,7 +160,7 @@
public ItemStack func_185473_a(IBlockReader p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_) {
return new ItemStack(this);
}
@@ -737,6 +751,7 @@
@@ -737,6 +756,7 @@
}
}
@@ -163,7 +168,7 @@
public SoundType func_185467_w() {
return this.field_149762_H;
}
@@ -758,11 +773,11 @@
@@ -758,11 +778,11 @@
}
public static boolean func_196252_e(Block p_196252_0_) {
@@ -177,7 +182,7 @@
}
public static void func_149671_p() {
@@ -1129,7 +1144,7 @@
@@ -1129,7 +1149,7 @@
func_196254_a("chiseled_quartz_block", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
func_196254_a("quartz_pillar", new BlockRotatedPillar(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_151677_p).func_200943_b(0.8F)));
func_196254_a("quartz_stairs", new BlockStairs(block42.func_176223_P(), Block.Properties.func_200950_a(block42)));
@@ -186,7 +191,7 @@
func_196254_a("dropper", new BlockDropper(Block.Properties.func_200945_a(Material.field_151576_e).func_200943_b(3.5F)));
func_196254_a("white_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193561_M).func_200948_a(1.25F, 4.2F)));
func_196254_a("orange_terracotta", new Block(Block.Properties.func_200949_a(Material.field_151576_e, MaterialColor.field_193562_N).func_200948_a(1.25F, 4.2F)));
@@ -1455,6 +1470,7 @@
@@ -1455,6 +1475,7 @@
func_196254_a("bubble_column", new BlockBubbleColumn(Block.Properties.func_200945_a(Material.field_203244_i).func_200942_a()));
func_196254_a("structure_block", new BlockStructure(Block.Properties.func_200949_a(Material.field_151573_f, MaterialColor.field_197656_x).func_200948_a(-1.0F, 3600000.0F)));
@@ -194,7 +199,7 @@
for(Block block85 : IRegistry.field_212618_g) {
for(IBlockState iblockstate : block85.func_176194_O().func_177619_a()) {
field_176229_d.func_195867_b(iblockstate);
@@ -1594,4 +1610,83 @@
@@ -1594,4 +1615,83 @@
return Objects.hash(this.field_212164_a, this.field_212165_b, this.field_212166_c);
}
}
@@ -22,3 +22,12 @@
}
private static boolean func_176530_e(IWorldReaderBase p_176530_0_, BlockPos p_176530_1_) {
@@ -102,7 +102,7 @@
}
}
- return false;
+ return net.minecraftforge.common.FarmlandWaterManager.hasBlockWaterTicket(p_176530_0_, p_176530_1_);
}
public IItemProvider func_199769_a(IBlockState p_199769_1_, World p_199769_2_, BlockPos p_199769_3_, int p_199769_4_) {
@@ -36,6 +36,15 @@
}
}, "keyPressed event handler", iguieventlistener.getClass().getCanonicalName());
@@ -341,7 +348,7 @@
}
}
}
-
+ net.minecraftforge.client.ForgeHooksClient.fireKeyInput(p_197961_3_, p_197961_4_, p_197961_5_, p_197961_6_);
}
}
@@ -351,12 +358,16 @@
if (iguieventlistener != null) {
if (Character.charCount(p_197963_3_) == 1) {
@@ -1,6 +1,14 @@
--- a/net/minecraft/client/Minecraft.java
+++ b/net/minecraft/client/Minecraft.java
@@ -314,7 +314,7 @@
@@ -297,6 +297,7 @@
public Minecraft(GameConfiguration p_i45547_1_) {
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;
@@ -314,7 +315,7 @@
supplier = p_211818_2_;
}
@@ -9,7 +17,7 @@
});
this.field_110448_aq.func_198982_a(this.field_195554_ax);
this.field_110448_aq.func_198982_a(new FolderPackFinder(this.field_130070_K));
@@ -322,7 +322,6 @@
@@ -322,7 +323,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());
@@ -17,7 +25,7 @@
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_147129_ai = func_147122_X();
this.field_71437_Z = null;
@@ -409,9 +408,11 @@
@@ -409,9 +409,11 @@
this.field_135017_as = new LanguageManager(this.field_71474_y.field_74363_ab);
this.field_110451_am.func_199006_a(this.field_135017_as);
this.field_71474_y.func_198017_a(this.field_110448_aq);
@@ -29,7 +37,7 @@
this.field_195558_d.func_198098_h();
this.func_147108_a(new GuiScreenLoading());
this.func_195547_ap();
@@ -429,6 +430,8 @@
@@ -429,6 +431,8 @@
this.field_110451_am.func_199006_a(new GrassColorReloadListener());
this.field_110451_am.func_199006_a(new FoliageColorReloadListener());
@@ -38,7 +46,7 @@
this.field_195558_d.func_198076_a("Startup");
GlStateManager.func_179098_w();
GlStateManager.func_179103_j(7425);
@@ -442,19 +445,24 @@
@@ -442,19 +446,24 @@
GlStateManager.func_179096_D();
GlStateManager.func_179128_n(5888);
this.field_195558_d.func_198076_a("Post startup");
@@ -63,7 +71,7 @@
this.field_71460_t = new GameRenderer(this, this.field_110451_am);
this.field_110451_am.func_199006_a(this.field_71460_t);
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
@@ -465,7 +473,10 @@
@@ -465,7 +474,10 @@
this.field_110451_am.func_199006_a(this.field_193995_ae);
GlStateManager.func_179083_b(0, 0, this.field_195558_d.func_198109_k(), this.field_195558_d.func_198091_l());
this.field_71452_i = new ParticleManager(this.field_71441_e, this.field_71446_o);
@@ -75,7 +83,7 @@
if (this.field_71475_ae != null) {
this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af));
} else {
@@ -474,6 +485,7 @@
@@ -474,6 +486,7 @@
this.field_184132_p = new DebugRenderer(this);
GLFW.glfwSetErrorCallback(this::func_195545_a).free();
@@ -83,7 +91,7 @@
if (this.field_71474_y.field_74353_u && !this.field_195558_d.func_198113_j()) {
this.field_195558_d.func_198077_g();
}
@@ -489,7 +501,7 @@
@@ -489,7 +502,7 @@
});
List<String> list = Lists.newArrayList();
GLFWErrorCallback glfwerrorcallback = GLFW.glfwSetErrorCallback((p_211100_1_, p_211100_2_) -> {
@@ -92,7 +100,7 @@
});
if (!GLFW.glfwInit()) {
throw new IllegalStateException("Failed to initialize GLFW, errors: " + Joiner.on(",").join(list));
@@ -599,7 +611,7 @@
@@ -599,7 +612,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());
@@ -101,7 +109,7 @@
} else if (p_71377_1_.func_147149_a(file2)) {
Bootstrap.func_179870_a("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath());
System.exit(-1);
@@ -614,6 +626,7 @@
@@ -614,6 +627,7 @@
return this.field_71474_y.field_211842_aO;
}
@@ -109,7 +117,7 @@
public void func_110436_a() {
this.field_110448_aq.func_198983_a();
List<IResourcePack> list = this.field_110448_aq.func_198980_d().stream().map(ResourcePackInfo::func_195796_e).collect(Collectors.toList());
@@ -668,16 +681,20 @@
@@ -668,16 +682,20 @@
}
public void func_147108_a(@Nullable GuiScreen p_147108_1_) {
@@ -134,7 +142,7 @@
if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer) {
this.field_71474_y.field_74330_P = false;
this.field_71456_v.func_146158_b().func_146231_a(true);
@@ -761,7 +778,7 @@
@@ -761,7 +779,7 @@
GLFW.glfwPollEvents();
long i1 = Util.func_211178_c() - l;
this.field_71424_I.func_76318_c("sound");
@@ -143,7 +151,7 @@
this.field_71424_I.func_76319_b();
this.field_71424_I.func_76320_a("render");
GlStateManager.func_179094_E();
@@ -771,11 +788,13 @@
@@ -771,11 +789,13 @@
GlStateManager.func_179098_w();
this.field_71424_I.func_76319_b();
if (!this.field_71454_w) {
@@ -157,7 +165,7 @@
}
this.field_71424_I.func_76319_b();
@@ -994,8 +1013,8 @@
@@ -994,8 +1014,8 @@
if (this.field_71429_W <= 0 && !this.field_71439_g.func_184587_cr()) {
if (p_147115_1_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK) {
BlockPos blockpos = this.field_71476_x.func_178782_a();
@@ -168,7 +176,7 @@
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
}
@@ -1020,7 +1039,7 @@
@@ -1020,7 +1040,7 @@
break;
case BLOCK:
BlockPos blockpos = this.field_71476_x.func_178782_a();
@@ -177,7 +185,7 @@
this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
break;
}
@@ -1030,6 +1049,7 @@
@@ -1030,6 +1050,7 @@
}
this.field_71439_g.func_184821_cY();
@@ -185,7 +193,7 @@
}
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
@@ -1060,7 +1080,7 @@
@@ -1060,7 +1081,7 @@
break;
case BLOCK:
BlockPos blockpos = this.field_71476_x.func_178782_a();
@@ -194,7 +202,7 @@
int i = itemstack.func_190916_E();
EnumActionResult enumactionresult = this.field_71442_b.func_187099_a(this.field_71439_g, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f, enumhand);
if (enumactionresult == EnumActionResult.SUCCESS) {
@@ -1079,6 +1099,9 @@
@@ -1079,6 +1100,9 @@
}
}
@@ -204,7 +212,7 @@
if (!itemstack.func_190926_b() && this.field_71442_b.func_187101_a(this.field_71439_g, this.field_71441_e, enumhand) == EnumActionResult.SUCCESS) {
this.field_71460_t.field_78516_c.func_187460_a(enumhand);
return;
@@ -1098,6 +1121,8 @@
@@ -1098,6 +1122,8 @@
--this.field_71467_ac;
}
@@ -213,7 +221,7 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n) {
this.field_71456_v.func_73831_a();
@@ -1220,6 +1245,8 @@
@@ -1220,6 +1246,8 @@
this.field_71424_I.func_76318_c("keyboard");
this.field_195559_v.func_204870_b();
this.field_71424_I.func_76319_b();
@@ -222,11 +230,11 @@
}
private void func_184117_aA() {
@@ -1378,6 +1405,14 @@
@@ -1378,6 +1406,14 @@
guiscreenworking.func_200209_c(new TextComponentString(""));
}
+ if (!net.minecraftforge.fml.StartupQuery.check()) {
+ if (!net.minecraftforge.fml.StartupQuery.check() || this.field_71437_Z.func_71241_aa()) {
+ this.func_147108_a(null);
+ return;
+ } else {
@@ -237,7 +245,7 @@
this.func_195542_b(false);
try {
@@ -1397,7 +1432,12 @@
@@ -1397,7 +1433,12 @@
networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {
}));
networkmanager.func_179290_a(new CPacketHandshake(socketaddress.toString(), 0, EnumConnectionState.LOGIN));
@@ -251,7 +259,7 @@
this.field_71453_ak = networkmanager;
}
@@ -1411,6 +1451,7 @@
@@ -1411,6 +1452,7 @@
}
public void func_205055_a(@Nullable WorldClient p_205055_1_, GuiScreen p_205055_2_) {
@@ -259,7 +267,7 @@
if (p_205055_1_ == null) {
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
if (nethandlerplayclient != null) {
@@ -1447,6 +1488,7 @@
@@ -1447,6 +1489,7 @@
}
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_205055_1_);
@@ -267,7 +275,7 @@
if (p_205055_1_ != null) {
if (!this.field_71455_al) {
AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString());
@@ -1493,6 +1535,7 @@
@@ -1493,6 +1536,7 @@
EntityPlayerSP entityplayersp = this.field_71439_g;
this.field_71439_g = this.field_71442_b.func_199681_a(this.field_71441_e, this.field_71439_g == null ? new StatisticsManager() : this.field_71439_g.func_146107_m(), this.field_71439_g == null ? new RecipeBookClient(new RecipeManager()) : this.field_71439_g.func_199507_B());
this.field_71439_g.func_184212_Q().func_187218_a(entityplayersp.func_184212_Q().func_187231_c());
@@ -275,7 +283,7 @@
this.field_71439_g.field_71093_bK = p_212315_1_;
this.field_175622_Z = this.field_71439_g;
this.field_71439_g.func_70065_x();
@@ -1532,110 +1575,8 @@
@@ -1532,110 +1576,8 @@
private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS) {
@@ -388,7 +396,7 @@
}
}
@@ -1712,6 +1653,7 @@
@@ -1712,6 +1654,7 @@
return field_71432_P;
}
@@ -396,7 +404,7 @@
public ListenableFuture<Object> func_175603_A() {
return this.func_152344_a(this::func_110436_a);
}
@@ -1871,6 +1813,8 @@
@@ -1871,6 +1814,8 @@
}
public MusicTicker.MusicType func_147109_W() {
@@ -405,7 +413,7 @@
if (this.field_71462_r instanceof GuiWinGame) {
return MusicTicker.MusicType.CREDITS;
} else if (this.field_71439_g == null) {
@@ -2010,4 +1954,12 @@
@@ -2010,4 +1955,12 @@
public FontResourceManager func_211500_ak() {
return this.field_211501_aD;
}
@@ -18,6 +18,15 @@
}, "mouseReleased event handler", this.field_198036_a.field_71462_r.getClass().getCanonicalName());
}
}
@@ -103,7 +107,7 @@
}
}
}
-
+ net.minecraftforge.client.ForgeHooksClient.fireMouseInput(p_198023_3_, p_198023_4_, p_198023_5_);
}
}
@@ -111,7 +115,9 @@
if (p_198020_1_ == Minecraft.func_71410_x().field_195558_d.func_198092_i()) {
double d0 = p_198020_5_ * this.field_198036_a.field_71474_y.field_208033_V;
@@ -1,5 +1,14 @@
--- a/net/minecraft/client/entity/AbstractClientPlayer.java
+++ b/net/minecraft/client/entity/AbstractClientPlayer.java
@@ -114,7 +114,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.ItemBow) {
int i = this.func_184612_cw();
float f1 = (float)i / 20.0F;
if (f1 > 1.0F) {
@@ -126,6 +126,6 @@
f *= 1.0F - f1 * 0.15F;
}
@@ -28,7 +28,7 @@
+ // FORGE - Move status icon check down from above so renderHUDEffect will still be called without a status icon
+ if (potion.func_76400_d())
this.func_73729_b(k + 3, l + 3, l1 * 18, 198 + k1 * 18, 18, 18);
+ potion.renderHUDEffect(k, l, potioneffect, field_73839_d, f);
+ potion.renderHUDEffect(potioneffect, this, k, l, this.field_73735_i, f);
}
}
@@ -8,7 +8,15 @@
import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ClickType;
@@ -97,7 +96,8 @@
@@ -68,6 +67,7 @@
int i = this.field_147003_i;
int j = this.field_147009_r;
this.func_146976_a(p_73863_3_, p_73863_1_, p_73863_2_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiContainerEvent.DrawBackground(this, p_73863_1_, p_73863_2_));
GlStateManager.func_179101_C();
RenderHelper.func_74518_a();
GlStateManager.func_179140_f();
@@ -97,7 +97,8 @@
int j1 = slot.field_75223_e;
int k1 = slot.field_75221_f;
GlStateManager.func_179135_a(true, true, true, false);
@@ -18,7 +26,7 @@
GlStateManager.func_179135_a(true, true, true, true);
GlStateManager.func_179145_e();
GlStateManager.func_179126_j();
@@ -107,6 +107,7 @@
@@ -107,6 +108,7 @@
RenderHelper.func_74518_a();
this.func_146979_b(p_73863_1_, p_73863_2_);
RenderHelper.func_74520_c();
@@ -26,7 +34,7 @@
InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by;
ItemStack itemstack = this.field_147012_x.func_190926_b() ? inventoryplayer.func_70445_o() : this.field_147012_x;
if (!itemstack.func_190926_b()) {
@@ -158,8 +159,10 @@
@@ -158,8 +160,10 @@
GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F);
this.field_73735_i = 200.0F;
this.field_146296_j.field_77023_b = 200.0F;
@@ -38,7 +46,7 @@
this.field_73735_i = 0.0F;
this.field_146296_j.field_77023_b = 0.0F;
}
@@ -203,11 +206,10 @@
@@ -203,11 +207,10 @@
this.field_73735_i = 100.0F;
this.field_146296_j.field_77023_b = 100.0F;
if (itemstack.func_190926_b() && p_146977_1_.func_111238_b()) {
@@ -53,7 +61,7 @@
this.func_175175_a(i, j, textureatlassprite, 16, 16);
GlStateManager.func_179145_e();
flag1 = true;
@@ -268,7 +270,8 @@
@@ -268,7 +271,8 @@
if (super.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_)) {
return true;
} else {
@@ -63,7 +71,7 @@
Slot slot = this.func_195360_a(p_mouseClicked_1_, p_mouseClicked_3_);
long i = Util.func_211177_b();
this.field_146993_M = this.field_146998_K == slot && i - this.field_146997_J < 250L && this.field_146992_L == p_mouseClicked_5_;
@@ -277,6 +280,7 @@
@@ -277,6 +281,7 @@
int j = this.field_147003_i;
int k = this.field_147009_r;
boolean flag1 = this.func_195361_a(p_mouseClicked_1_, p_mouseClicked_3_, j, k, p_mouseClicked_5_);
@@ -71,7 +79,7 @@
int l = -1;
if (slot != null) {
l = slot.field_75222_d;
@@ -302,7 +306,7 @@
@@ -302,7 +307,7 @@
}
} else if (!this.field_147007_t) {
if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b()) {
@@ -80,7 +88,7 @@
this.func_184098_a(slot, l, p_mouseClicked_5_, ClickType.CLONE);
} else {
boolean flag2 = l != -999 && (InputMappings.func_197956_a(340) || InputMappings.func_197956_a(344));
@@ -326,7 +330,7 @@
@@ -326,7 +331,7 @@
this.field_146987_F = 0;
} else if (p_mouseClicked_5_ == 1) {
this.field_146987_F = 1;
@@ -89,7 +97,7 @@
this.field_146987_F = 2;
}
}
@@ -379,10 +383,13 @@
@@ -379,10 +384,13 @@
}
public boolean mouseReleased(double p_mouseReleased_1_, double p_mouseReleased_3_, int p_mouseReleased_5_) {
@@ -103,7 +111,7 @@
int k = -1;
if (slot != null) {
k = slot.field_75222_d;
@@ -396,7 +403,7 @@
@@ -396,7 +404,7 @@
if (func_146272_n()) {
if (!this.field_146994_N.func_190926_b()) {
for(Slot slot2 : this.field_147002_h.field_75151_b) {
@@ -112,7 +120,7 @@
this.func_184098_a(slot2, slot2.field_75222_d, p_mouseReleased_5_, ClickType.QUICK_MOVE);
}
}
@@ -460,7 +467,7 @@
@@ -460,7 +468,7 @@
this.func_184098_a((Slot)null, -999, Container.func_94534_d(2, this.field_146987_F), ClickType.QUICK_CRAFT);
} else if (!this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b()) {
@@ -121,26 +129,36 @@
this.func_184098_a(slot, k, p_mouseReleased_5_, ClickType.CLONE);
} else {
boolean flag1 = k != -999 && (InputMappings.func_197956_a(340) || InputMappings.func_197956_a(344));
@@ -509,15 +516,15 @@
@@ -509,27 +517,31 @@
if (super.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_)) {
return true;
} else {
- if (p_keyPressed_1_ == 256 || this.field_146297_k.field_71474_y.field_151445_Q.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) {
+ if (p_keyPressed_1_ == 256 || this.field_146297_k.field_71474_y.field_151445_Q.isActiveAndMatches(InputMappings.func_197954_a(p_keyPressed_1_, p_keyPressed_2_))) {
this.field_146297_k.field_71439_g.func_71053_j();
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
}
this.func_195363_d(p_keyPressed_1_, p_keyPressed_2_);
- this.func_195363_d(p_keyPressed_1_, p_keyPressed_2_);
+ if (this.func_195363_d(p_keyPressed_1_, p_keyPressed_2_))
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
if (this.field_147006_u != null && this.field_147006_u.func_75216_d()) {
- if (this.field_146297_k.field_71474_y.field_74322_I.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) {
+ if (this.field_146297_k.field_71474_y.field_74322_I.isActiveAndMatches(InputMappings.func_197954_a(p_keyPressed_1_, p_keyPressed_2_))) {
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, 0, ClickType.CLONE);
- } else if (this.field_146297_k.field_71474_y.field_74316_C.func_197976_a(p_keyPressed_1_, p_keyPressed_2_)) {
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
+ } else if (this.field_146297_k.field_71474_y.field_74316_C.isActiveAndMatches(InputMappings.func_197954_a(p_keyPressed_1_, p_keyPressed_2_))) {
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, func_146271_m() ? 1 : 0, ClickType.THROW);
+ return true; // Forge MC-146650: Needs to return true when the key is handled.
}
}
@@ -529,7 +536,7 @@
- return true;
+ return false; // Forge MC-146650: Needs to return false when the key is not handled.
}
}
protected boolean func_195363_d(int p_195363_1_, int p_195363_2_) {
if (this.field_146297_k.field_71439_g.field_71071_by.func_70445_o().func_190926_b() && this.field_147006_u != null) {
for(int i = 0; i < 9; ++i) {
@@ -149,7 +167,7 @@
this.func_184098_a(this.field_147006_u, this.field_147006_u.field_75222_d, i, ClickType.SWAP);
return true;
}
@@ -556,4 +563,16 @@
@@ -556,4 +568,16 @@
}
}
@@ -1,15 +1,86 @@
--- a/net/minecraft/client/renderer/BlockModelRenderer.java
+++ b/net/minecraft/client/renderer/BlockModelRenderer.java
@@ -45,7 +45,7 @@
@@ -44,11 +44,17 @@
this.field_187499_a = p_i46575_1_;
}
+ @Deprecated
public boolean func_199324_a(IWorldReader p_199324_1_, IBakedModel p_199324_2_, IBlockState p_199324_3_, BlockPos p_199324_4_, BufferBuilder p_199324_5_, boolean p_199324_6_, Random p_199324_7_, long p_199324_8_) {
- boolean flag = Minecraft.func_71379_u() && p_199324_3_.func_185906_d() == 0 && p_199324_2_.func_177555_b();
+ boolean flag = Minecraft.func_71379_u() && p_199324_3_.getLightValue(p_199324_1_, p_199324_4_) == 0 && p_199324_2_.isAmbientOcclusion(p_199324_3_);
+ return renderModel(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+ public boolean renderModel(IWorldReader p_199324_1_, IBakedModel p_199324_2_, IBlockState p_199324_3_, BlockPos p_199324_4_, BufferBuilder p_199324_5_, boolean p_199324_6_, Random p_199324_7_, long p_199324_8_, net.minecraftforge.client.model.data.IModelData modelData) {
+ boolean flag = Minecraft.func_71379_u() && p_199324_3_.getLightValue(p_199324_1_, p_199324_4_) == 0 && p_199324_2_.isAmbientOcclusion(p_199324_3_);
+ modelData = p_199324_2_.getModelData(p_199324_1_, p_199324_4_, p_199324_3_, modelData);
+
try {
return flag ? this.func_199326_b(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_) : this.func_199325_c(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_);
@@ -120,6 +120,13 @@
- return flag ? this.func_199326_b(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_) : this.func_199325_c(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_);
+ return flag ? this.renderModelSmooth(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_, modelData) : this.renderModelFlat(p_199324_1_, p_199324_2_, p_199324_3_, p_199324_4_, p_199324_5_, p_199324_6_, p_199324_7_, p_199324_8_, modelData);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.func_85055_a(throwable, "Tesselating block model");
CrashReportCategory crashreportcategory = crashreport.func_85058_a("Block model being tesselated");
@@ -58,7 +64,12 @@
}
}
+ @Deprecated
public boolean func_199326_b(IWorldReader p_199326_1_, IBakedModel p_199326_2_, IBlockState p_199326_3_, BlockPos p_199326_4_, BufferBuilder p_199326_5_, boolean p_199326_6_, Random p_199326_7_, long p_199326_8_) {
+ return renderModelSmooth(p_199326_1_, p_199326_2_, p_199326_3_, p_199326_4_, p_199326_5_, p_199326_6_, p_199326_7_, p_199326_8_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+
+ public boolean renderModelSmooth(IWorldReader p_199326_1_, IBakedModel p_199326_2_, IBlockState p_199326_3_, BlockPos p_199326_4_, BufferBuilder p_199326_5_, boolean p_199326_6_, Random p_199326_7_, long p_199326_8_, net.minecraftforge.client.model.data.IModelData modelData) {
boolean flag = false;
float[] afloat = new float[EnumFacing.values().length * 2];
BitSet bitset = new BitSet(3);
@@ -66,7 +77,7 @@
for(EnumFacing enumfacing : EnumFacing.values()) {
p_199326_7_.setSeed(p_199326_8_);
- List<BakedQuad> list = p_199326_2_.func_200117_a(p_199326_3_, enumfacing, p_199326_7_);
+ List<BakedQuad> list = p_199326_2_.getQuads(p_199326_3_, enumfacing, p_199326_7_, modelData);
if (!list.isEmpty() && (!p_199326_6_ || Block.func_176225_a(p_199326_3_, p_199326_1_, p_199326_4_, enumfacing))) {
this.func_187492_a(p_199326_1_, p_199326_3_, p_199326_4_, p_199326_5_, list, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
@@ -74,7 +85,7 @@
}
p_199326_7_.setSeed(p_199326_8_);
- List<BakedQuad> list1 = p_199326_2_.func_200117_a(p_199326_3_, (EnumFacing)null, p_199326_7_);
+ List<BakedQuad> list1 = p_199326_2_.getQuads(p_199326_3_, (EnumFacing)null, p_199326_7_, modelData);
if (!list1.isEmpty()) {
this.func_187492_a(p_199326_1_, p_199326_3_, p_199326_4_, p_199326_5_, list1, afloat, bitset, blockmodelrenderer$ambientocclusionface);
flag = true;
@@ -83,13 +94,18 @@
return flag;
}
+ @Deprecated
public boolean func_199325_c(IWorldReader p_199325_1_, IBakedModel p_199325_2_, IBlockState p_199325_3_, BlockPos p_199325_4_, BufferBuilder p_199325_5_, boolean p_199325_6_, Random p_199325_7_, long p_199325_8_) {
+ return renderModelFlat(p_199325_1_, p_199325_2_, p_199325_3_, p_199325_4_, p_199325_5_, p_199325_6_, p_199325_7_, p_199325_8_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+
+ public boolean renderModelFlat(IWorldReader p_199325_1_, IBakedModel p_199325_2_, IBlockState p_199325_3_, BlockPos p_199325_4_, BufferBuilder p_199325_5_, boolean p_199325_6_, Random p_199325_7_, long p_199325_8_, net.minecraftforge.client.model.data.IModelData modelData) {
boolean flag = false;
BitSet bitset = new BitSet(3);
for(EnumFacing enumfacing : EnumFacing.values()) {
p_199325_7_.setSeed(p_199325_8_);
- List<BakedQuad> list = p_199325_2_.func_200117_a(p_199325_3_, enumfacing, p_199325_7_);
+ List<BakedQuad> list = p_199325_2_.getQuads(p_199325_3_, enumfacing, p_199325_7_, modelData);
if (!list.isEmpty() && (!p_199325_6_ || Block.func_176225_a(p_199325_3_, p_199325_1_, p_199325_4_, enumfacing))) {
int i = p_199325_3_.func_185889_a(p_199325_1_, p_199325_4_.func_177972_a(enumfacing));
this.func_187496_a(p_199325_1_, p_199325_3_, p_199325_4_, i, false, p_199325_5_, list, bitset);
@@ -98,7 +114,7 @@
}
p_199325_7_.setSeed(p_199325_8_);
- List<BakedQuad> list1 = p_199325_2_.func_200117_a(p_199325_3_, (EnumFacing)null, p_199325_7_);
+ List<BakedQuad> list1 = p_199325_2_.getQuads(p_199325_3_, (EnumFacing)null, p_199325_7_, modelData);
if (!list1.isEmpty()) {
this.func_187496_a(p_199325_1_, p_199325_3_, p_199325_4_, -1, true, p_199325_5_, list1, bitset);
flag = true;
@@ -120,6 +136,13 @@
p_187492_8_.func_187491_a(p_187492_1_, p_187492_2_, p_187492_3_, bakedquad.func_178210_d(), p_187492_6_, p_187492_7_);
p_187492_4_.func_178981_a(bakedquad.func_178209_a());
p_187492_4_.func_178962_a(p_187492_8_.field_178207_c[0], p_187492_8_.field_178207_c[1], p_187492_8_.field_178207_c[2], p_187492_8_.field_178207_c[3]);
@@ -23,7 +94,7 @@
if (bakedquad.func_178212_b()) {
int k = this.field_187499_a.func_186724_a(p_187492_2_, p_187492_1_, p_187492_3_, bakedquad.func_178211_c());
float f = (float)(k >> 16 & 255) / 255.0F;
@@ -229,10 +236,22 @@
@@ -229,10 +252,22 @@
float f = (float)(k >> 16 & 255) / 255.0F;
float f1 = (float)(k >> 8 & 255) / 255.0F;
float f2 = (float)(k & 255) / 255.0F;
@@ -9,7 +9,7 @@
this.field_175025_e = new BlockFluidRenderer();
}
@@ -40,7 +40,7 @@
@@ -40,12 +40,17 @@
if (p_175020_1_.func_185901_i() == EnumBlockRenderType.MODEL) {
IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
long i = p_175020_1_.func_209533_a(p_175020_2_);
@@ -18,16 +18,26 @@
this.field_175027_c.func_199324_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true, this.field_195476_e, i);
}
}
@@ -53,6 +53,8 @@
+ @Deprecated
public boolean func_195475_a(IBlockState p_195475_1_, BlockPos p_195475_2_, IWorldReader p_195475_3_, BufferBuilder p_195475_4_, Random p_195475_5_) {
+ return renderBlock(p_195475_1_, p_195475_2_, p_195475_3_, p_195475_4_, p_195475_5_, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
+
+ public boolean renderBlock(IBlockState p_195475_1_, BlockPos p_195475_2_, IWorldReader p_195475_3_, BufferBuilder p_195475_4_, Random p_195475_5_, net.minecraftforge.client.model.data.IModelData modelData) {
try {
EnumBlockRenderType enumblockrendertype = p_195475_1_.func_185901_i();
if (enumblockrendertype == EnumBlockRenderType.INVISIBLE) {
@@ -53,7 +58,7 @@
} else {
switch(enumblockrendertype) {
case MODEL:
+ IBakedModel model = this.func_184389_a(p_195475_1_);
+ p_195475_1_ = p_195475_1_.func_177230_c().getExtendedState(p_195475_1_, p_195475_3_, p_195475_2_);
return this.field_175027_c.func_199324_a(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_));
- return this.field_175027_c.func_199324_a(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_));
+ return this.field_175027_c.renderModel(p_195475_3_, this.func_184389_a(p_195475_1_), p_195475_1_, p_195475_2_, p_195475_4_, true, p_195475_5_, p_195475_1_.func_209533_a(p_195475_2_), modelData);
case ENTITYBLOCK_ANIMATED:
return false;
@@ -105,4 +107,9 @@
default:
@@ -105,4 +110,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175025_e.func_178268_a();
}
@@ -1,5 +1,14 @@
--- a/net/minecraft/client/renderer/FirstPersonRenderer.java
+++ b/net/minecraft/client/renderer/FirstPersonRenderer.java
@@ -273,7 +273,7 @@
boolean flag1 = true;
if (abstractclientplayer.func_184587_cr()) {
ItemStack itemstack = abstractclientplayer.func_184607_cu();
- if (itemstack.func_77973_b() == Items.field_151031_f) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow) {
flag = abstractclientplayer.func_184600_cs() == EnumHand.MAIN_HAND;
flag1 = !flag;
}
@@ -286,12 +286,14 @@
if (flag) {
float f4 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
@@ -138,7 +138,7 @@
protected void func_78474_d(float p_78474_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.func_201675_m().getWeatherRenderer();
+ if (renderer != null) {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ renderer.render(this.field_78529_t, p_78474_1_, this.field_78531_r.field_71441_e, this.field_78531_r);
+ return;
+ }
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
@@ -30,7 +30,7 @@
this.func_73729_b(i + 6, j + 7, i1 % 12 * 18, 198 + i1 / 12 * 18, 18, 18);
}
+ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k);
+ potion.renderInventoryEffect(potioneffect, this, i, j, this.field_73735_i);
+ if (!potion.shouldRenderInvText(potioneffect)) { j += l; continue; }
String s1 = I18n.func_135052_a(potion.func_76393_a());
if (potioneffect.func_76458_c() == 1) {
@@ -16,7 +16,18 @@
this.field_184395_f = p_i46552_3_;
}
@@ -97,7 +98,7 @@
@@ -74,6 +75,10 @@
}
private void func_191967_a(IBakedModel p_191967_1_, int p_191967_2_, ItemStack p_191967_3_) {
+ if (net.minecraftforge.common.ForgeConfig.CLIENT.allowEmissiveItems.get()) {
+ net.minecraftforge.client.ForgeHooksClient.renderLitItem(this, p_191967_1_, p_191967_2_, p_191967_3_);
+ return;
+ }
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
bufferbuilder.func_181668_a(7, DefaultVertexFormats.field_176599_b);
@@ -97,7 +102,7 @@
if (p_180454_2_.func_188618_c()) {
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179091_B();
@@ -25,7 +36,7 @@
} else {
this.func_191961_a(p_180454_2_, p_180454_1_);
if (p_180454_1_.func_77962_s()) {
@@ -163,7 +164,7 @@
@@ -163,7 +168,7 @@
k = k | -16777216;
}
@@ -34,7 +45,7 @@
}
}
@@ -224,11 +225,8 @@
@@ -224,11 +229,8 @@
GlStateManager.func_179147_l();
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.func_179094_E();
@@ -48,7 +59,7 @@
this.func_180454_a(p_184394_1_, p_184394_2_);
GlStateManager.func_187407_a(GlStateManager.CullFace.BACK);
@@ -259,7 +257,7 @@
@@ -259,7 +261,7 @@
GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
this.func_180452_a(p_191962_2_, p_191962_3_, p_191962_4_.func_177556_c());
@@ -57,7 +68,7 @@
this.func_180454_a(p_191962_1_, p_191962_4_);
GlStateManager.func_179118_c();
GlStateManager.func_179101_C();
@@ -298,6 +296,7 @@
@@ -298,6 +300,7 @@
crashreportcategory.func_189529_a("Item Type", () -> {
return String.valueOf((Object)p_184391_2_.func_77973_b());
});
@@ -65,7 +76,7 @@
crashreportcategory.func_189529_a("Item Damage", () -> {
return String.valueOf(p_184391_2_.func_77952_i());
});
@@ -329,9 +328,12 @@
@@ -329,9 +332,12 @@
GlStateManager.func_179147_l();
GlStateManager.func_179145_e();
GlStateManager.func_179126_j();
@@ -79,7 +90,7 @@
GlStateManager.func_179140_f();
GlStateManager.func_179097_i();
GlStateManager.func_179090_x();
@@ -339,11 +341,9 @@
@@ -339,11 +345,9 @@
GlStateManager.func_179084_k();
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
@@ -94,7 +105,7 @@
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(bufferbuilder, p_180453_3_ + 2, p_180453_4_ + 13, i, 1, j >> 16 & 255, j >> 8 & 255, j & 255, 255);
GlStateManager.func_179147_l();
@@ -382,4 +382,9 @@
@@ -382,4 +386,9 @@
public void func_195410_a(IResourceManager p_195410_1_) {
this.field_175059_m.func_178085_b();
}
@@ -110,7 +110,7 @@
public void func_195465_a(float p_195465_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getSkyRenderer();
+ if (renderer != null) {
+ renderer.render(p_195465_1_, field_72769_h, field_72777_q);
+ renderer.render(this.field_72773_u, p_195465_1_, this.field_72769_h, this.field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.THE_END) {
@@ -0,0 +1,26 @@
--- a/net/minecraft/client/renderer/chunk/ChunkRenderTask.java
+++ b/net/minecraft/client/renderer/chunk/ChunkRenderTask.java
@@ -19,11 +19,14 @@
private CompiledChunk field_178547_f;
private ChunkRenderTask.Status field_178548_g = ChunkRenderTask.Status.PENDING;
private boolean field_178554_h;
+ private java.util.Map<net.minecraft.util.math.BlockPos, net.minecraftforge.client.model.data.IModelData> modelData;
public ChunkRenderTask(RenderChunk p_i46560_1_, ChunkRenderTask.Type p_i46560_2_, double p_i46560_3_) {
this.field_178553_a = p_i46560_1_;
this.field_178549_d = p_i46560_2_;
this.field_188229_e = p_i46560_3_;
+
+ modelData = net.minecraftforge.client.model.ModelDataManager.getModelData(net.minecraft.client.Minecraft.func_71410_x().field_71441_e, new net.minecraft.util.math.ChunkPos(p_i46560_1_.func_178568_j()));
}
public ChunkRenderTask.Status func_178546_a() {
@@ -128,4 +131,8 @@
REBUILD_CHUNK,
RESORT_TRANSPARENCY;
}
+
+ public net.minecraftforge.client.model.data.IModelData getModelData(net.minecraft.util.math.BlockPos pos) {
+ return modelData.getOrDefault(pos, net.minecraftforge.client.model.data.EmptyModelData.INSTANCE);
+ }
}
@@ -19,7 +19,7 @@
VisGraph lvt_11_1_ = new VisGraph();
HashSet lvt_12_1_ = Sets.newHashSet();
if (lvt_10_1_ != null) {
@@ -142,22 +143,23 @@
@@ -142,22 +143,24 @@
lvt_11_1_.func_178606_a(blockpos$mutableblockpos);
}
@@ -41,13 +41,14 @@
IFluidState ifluidstate = lvt_10_1_.func_204610_c(blockpos$mutableblockpos);
- if (!ifluidstate.func_206888_e()) {
- BlockRenderLayer blockrenderlayer1 = ifluidstate.func_180664_k();
+ net.minecraftforge.client.model.data.IModelData modelData = p_178581_4_.getModelData(blockpos$mutableblockpos);
+ for(BlockRenderLayer blockrenderlayer1 : BlockRenderLayer.values()) {
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(blockrenderlayer1);
+ if (!ifluidstate.func_206888_e() && ifluidstate.canRenderInLayer(blockrenderlayer1)) {
int j = blockrenderlayer1.ordinal();
BufferBuilder bufferbuilder = p_178581_4_.func_178545_d().func_179039_a(j);
if (!compiledchunk.func_178492_d(blockrenderlayer1)) {
@@ -168,17 +170,18 @@
@@ -168,17 +171,18 @@
aboolean[j] |= blockrendererdispatcher.func_205318_a(blockpos$mutableblockpos, lvt_10_1_, bufferbuilder, ifluidstate);
}
@@ -64,7 +65,8 @@
this.func_178573_a(bufferbuilder1, blockpos);
}
aboolean[k] |= blockrendererdispatcher.func_195475_a(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random);
- aboolean[k] |= blockrendererdispatcher.func_195475_a(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random);
+ aboolean[k] |= blockrendererdispatcher.renderBlock(iblockstate, blockpos$mutableblockpos, lvt_10_1_, bufferbuilder1, random, modelData);
}
+ }
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(null);
@@ -0,0 +1,11 @@
--- a/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java
+++ b/net/minecraft/client/renderer/entity/layers/LayerHeldItemWitch.java
@@ -43,7 +43,7 @@
GlStateManager.func_179114_b(-5.0F, 0.0F, 1.0F, 0.0F);
float f1 = 0.375F;
GlStateManager.func_179152_a(0.375F, -0.375F, 0.375F);
- } else if (item == Items.field_151031_f) {
+ } else if (item instanceof net.minecraft.item.ItemBow) {
GlStateManager.func_179109_b(0.0F, 0.125F, -0.125F);
GlStateManager.func_179114_b(-45.0F, 0.0F, 1.0F, 0.0F);
float f2 = 0.625F;
@@ -0,0 +1,20 @@
--- a/net/minecraft/client/renderer/entity/model/ModelSkeleton.java
+++ b/net/minecraft/client/renderer/entity/model/ModelSkeleton.java
@@ -42,7 +42,7 @@
this.field_187076_m = ModelBiped.ArmPose.EMPTY;
this.field_187075_l = ModelBiped.ArmPose.EMPTY;
ItemStack itemstack = p_78086_1_.func_184586_b(EnumHand.MAIN_HAND);
- if (itemstack.func_77973_b() == Items.field_151031_f && ((AbstractSkeleton)p_78086_1_).func_184725_db()) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow && ((AbstractSkeleton)p_78086_1_).func_184725_db()) {
if (p_78086_1_.func_184591_cq() == EnumHandSide.RIGHT) {
this.field_187076_m = ModelBiped.ArmPose.BOW_AND_ARROW;
} else {
@@ -57,7 +57,7 @@
super.func_78087_a(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_);
ItemStack itemstack = ((EntityLivingBase)p_78087_7_).func_184614_ca();
AbstractSkeleton abstractskeleton = (AbstractSkeleton)p_78087_7_;
- if (abstractskeleton.func_184725_db() && (itemstack.func_190926_b() || itemstack.func_77973_b() != Items.field_151031_f)) {
+ if (abstractskeleton.func_184725_db() && (itemstack.func_190926_b() || !(itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow))) {
float f = MathHelper.func_76126_a(this.field_78095_p * (float)Math.PI);
float f1 = MathHelper.func_76126_a((1.0F - (1.0F - this.field_78095_p) * (1.0F - this.field_78095_p)) * (float)Math.PI);
this.field_178723_h.field_78808_h = 0.0F;
@@ -1,6 +1,14 @@
--- a/net/minecraft/client/renderer/model/BakedQuadRetextured.java
+++ b/net/minecraft/client/renderer/model/BakedQuadRetextured.java
@@ -17,10 +17,15 @@
@@ -10,17 +10,22 @@
private final TextureAtlasSprite field_178218_d;
public BakedQuadRetextured(BakedQuad p_i46217_1_, TextureAtlasSprite p_i46217_2_) {
- super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a());
+ super(Arrays.copyOf(p_i46217_1_.func_178209_a(), p_i46217_1_.func_178209_a().length), p_i46217_1_.field_178213_b, FaceBakery.func_178410_a(p_i46217_1_.func_178209_a()), p_i46217_1_.func_187508_a(), p_i46217_1_.shouldApplyDiffuseLighting(), p_i46217_1_.getFormat());
this.field_178218_d = p_i46217_2_;
this.func_178217_e();
}
private void func_178217_e() {
for(int i = 0; i < 4; ++i) {
@@ -1,15 +1,17 @@
--- a/net/minecraft/client/renderer/model/IBakedModel.java
+++ b/net/minecraft/client/renderer/model/IBakedModel.java
@@ -10,7 +10,7 @@
@@ -10,7 +10,9 @@
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
-public interface IBakedModel {
+public interface IBakedModel extends net.minecraftforge.client.extensions.IForgeBakedModel {
+
+ @Deprecated
List<BakedQuad> func_200117_a(@Nullable IBlockState p_200117_1_, @Nullable EnumFacing p_200117_2_, Random p_200117_3_);
boolean func_177555_b();
@@ -21,7 +21,8 @@
@@ -21,7 +23,8 @@
TextureAtlasSprite func_177554_e();
@@ -17,6 +17,6 @@
- IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_);
+ @Deprecated
+ default IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_) {
+ return bake(p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176600_a);
+ return bake(p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_, net.minecraft.client.renderer.vertex.DefaultVertexFormats.field_176599_b);
+ }
}
@@ -1,5 +1,14 @@
--- a/net/minecraft/command/impl/TeleportCommand.java
+++ b/net/minecraft/command/impl/TeleportCommand.java
@@ -54,7 +54,7 @@
private static int func_201126_a(CommandSource p_201126_0_, Collection<? extends Entity> p_201126_1_, Entity p_201126_2_) {
for(Entity entity : p_201126_1_) {
- func_201127_a(p_201126_0_, entity, p_201126_0_.func_197023_e(), p_201126_2_.field_70165_t, p_201126_2_.field_70163_u, p_201126_2_.field_70161_v, EnumSet.noneOf(SPacketPlayerPosLook.EnumFlags.class), p_201126_2_.field_70177_z, p_201126_2_.field_70125_A, (TeleportCommand.Facing)null);
+ func_201127_a(p_201126_0_, entity, (WorldServer) p_201126_2_.func_130014_f_(), p_201126_2_.field_70165_t, p_201126_2_.field_70163_u, p_201126_2_.field_70161_v, EnumSet.noneOf(SPacketPlayerPosLook.EnumFlags.class), p_201126_2_.field_70177_z, p_201126_2_.field_70125_A, (TeleportCommand.Facing)null); // Forge: Fix MC-128441 cross-dimension teleporting does not work
}
if (p_201126_1_.size() == 1) {
@@ -135,9 +135,9 @@
p_201127_1_.func_70034_d(f);
} else {
@@ -8,7 +8,25 @@
}
public String func_71501_a() {
@@ -132,6 +133,7 @@
@@ -115,23 +116,13 @@
throwable.setStackTrace(this.field_71511_b.getStackTrace());
}
- String s;
- try {
- stringwriter = new StringWriter();
- printwriter = new PrintWriter(stringwriter);
- throwable.printStackTrace(printwriter);
- s = stringwriter.toString();
- } finally {
- IOUtils.closeQuietly((Writer)stringwriter);
- IOUtils.closeQuietly((Writer)printwriter);
- }
-
- return s;
+ return net.minecraftforge.fml.CrashReportExtender.generateEnhancedStackTrace(throwable);
}
public String func_71502_e() {
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.append("---- Minecraft Crash Report ----\n");
@@ -6,7 +6,7 @@
IBlockState iblockstate2 = p_185266_1_.func_180495_p(blockpos$mutableblockpos1);
- if (iblockstate2.func_185904_a() == Material.field_151586_h && iblockstate2.func_177229_b(BlockFlowingFluid.field_176367_b) == 0 && iblockstate.func_196955_c(p_185266_1_, blockpos$mutableblockpos1) && p_185266_1_.func_195584_a(iblockstate, blockpos$mutableblockpos1)) {
+ boolean isFull = iblockstate2.func_177230_c() == Blocks.field_150355_j && iblockstate2.func_177229_b(BlockFlowingFluid.field_176367_b) == 0; //TODO: Forge, modded waters?
+ if (iblockstate2.func_185904_a() == Material.field_151586_h && isFull && iblockstate.func_196955_c(p_185266_1_, blockpos$mutableblockpos1) && p_185266_1_.func_195584_a(iblockstate, blockpos$mutableblockpos1)) {
+ if (iblockstate2.func_185904_a() == Material.field_151586_h && isFull && iblockstate.func_196955_c(p_185266_1_, blockpos$mutableblockpos1) && p_185266_1_.func_195584_a(iblockstate, blockpos$mutableblockpos1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_185266_0_, new net.minecraftforge.common.util.BlockSnapshot(p_185266_1_, blockpos$mutableblockpos1.func_185334_h(), iblockstate2), net.minecraft.util.EnumFacing.UP)) {
p_185266_1_.func_175656_a(blockpos$mutableblockpos1, iblockstate);
p_185266_1_.func_205220_G_().func_205360_a(blockpos$mutableblockpos1.func_185334_h(), Blocks.field_185778_de, MathHelper.func_76136_a(p_185266_0_.func_70681_au(), 60, 120));
}
@@ -47,15 +47,16 @@
while(i > 0) {
int j = EntityXPOrb.func_70527_a(i);
i -= j;
@@ -412,6 +418,7 @@
public void func_70604_c(@Nullable EntityLivingBase p_70604_1_) {
this.field_70755_b = p_70604_1_;
this.field_70756_c = this.field_70173_aa;
+ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_);
}
public EntityLivingBase func_110144_aD() {
@@ -584,8 +591,10 @@
@@ -534,7 +540,7 @@
Potion potion = iterator.next();
PotionEffect potioneffect = this.field_70713_bf.get(potion);
if (!potioneffect.func_76455_a(this)) {
- if (!this.field_70170_p.field_72995_K) {
+ if (!this.field_70170_p.field_72995_K && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionExpiryEvent(this, potioneffect))) {
iterator.remove();
this.func_70688_c(potioneffect);
}
@@ -584,8 +590,10 @@
this.func_82142_c(false);
} else {
Collection<PotionEffect> collection = this.field_70713_bf.values();
@@ -68,7 +69,19 @@
this.func_82142_c(this.func_70644_a(MobEffects.field_76441_p));
}
@@ -622,6 +631,27 @@
@@ -614,7 +622,10 @@
boolean flag;
for(flag = false; iterator.hasNext(); flag = true) {
- this.func_70688_c(iterator.next());
+ PotionEffect effect = iterator.next();
+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionRemoveEvent(this, effect))) continue;
+
+ this.func_70688_c(effect);
iterator.remove();
}
@@ -622,6 +633,27 @@
}
}
@@ -83,7 +96,7 @@
+ Iterator<PotionEffect> itr = this.field_70713_bf.values().iterator();
+ while (itr.hasNext()) {
+ PotionEffect effect = itr.next();
+ if (effect.isCurativeItem(curativeItem)) {
+ if (effect.isCurativeItem(curativeItem) && !net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionRemoveEvent(this, effect))) {
+ this.func_70688_c(effect);
+ itr.remove();
+ ret = true;
@@ -96,7 +109,33 @@
public Collection<PotionEffect> func_70651_bq() {
return this.field_70713_bf.values();
}
@@ -714,6 +744,8 @@
@@ -644,6 +676,7 @@
return false;
} else {
PotionEffect potioneffect = this.field_70713_bf.get(p_195064_1_.func_188419_a());
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionAddedEvent(this, potioneffect, p_195064_1_));
if (potioneffect == null) {
this.field_70713_bf.put(p_195064_1_.func_188419_a(), p_195064_1_);
this.func_70670_a(p_195064_1_);
@@ -658,6 +691,9 @@
}
public boolean func_70687_e(PotionEffect p_70687_1_) {
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ if (event.getResult() != net.minecraftforge.eventbus.api.Event.Result.DEFAULT) return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW;
if (this.func_70668_bt() == CreatureAttribute.UNDEAD) {
Potion potion = p_70687_1_.func_188419_a();
if (potion == MobEffects.field_76428_l || potion == MobEffects.field_76436_u) {
@@ -678,6 +714,7 @@
}
public boolean func_195063_d(Potion p_195063_1_) {
+ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.living.PotionEvent.PotionRemoveEvent(this, p_195063_1_))) return false;
PotionEffect potioneffect = this.func_184596_c(p_195063_1_);
if (potioneffect != null) {
this.func_70688_c(potioneffect);
@@ -714,6 +751,8 @@
}
public void func_70691_i(float p_70691_1_) {
@@ -105,7 +144,7 @@
float f = this.func_110143_aJ();
if (f > 0.0F) {
this.func_70606_j(f + p_70691_1_);
@@ -730,6 +762,7 @@
@@ -730,6 +769,7 @@
}
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
@@ -113,7 +152,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_70170_p.field_72995_K) {
@@ -790,8 +823,8 @@
@@ -790,8 +830,8 @@
if (entity1 instanceof EntityPlayer) {
this.field_70718_bc = 100;
this.field_70717_bb = (EntityPlayer)entity1;
@@ -124,7 +163,7 @@
if (entitywolf.func_70909_n()) {
this.field_70718_bc = 100;
this.field_70717_bb = null;
@@ -941,11 +974,12 @@
@@ -941,11 +981,12 @@
}
public void func_70669_a(ItemStack p_70669_1_) {
@@ -138,7 +177,7 @@
if (!this.field_70729_aU) {
Entity entity = p_70645_1_.func_76346_g();
EntityLivingBase entitylivingbase = this.func_94060_bK();
@@ -960,15 +994,16 @@
@@ -960,15 +1001,16 @@
this.field_70729_aU = true;
this.func_110142_aN().func_94549_h();
if (!this.field_70170_p.field_72995_K) {
@@ -159,7 +198,7 @@
}
this.field_70170_p.func_72960_a(this, (byte)3);
@@ -984,6 +1019,9 @@
@@ -984,6 +1026,9 @@
}
public void func_70653_a(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {
@@ -169,7 +208,7 @@
if (!(this.field_70146_Z.nextDouble() < this.func_110148_a(SharedMonsterAttributes.field_111266_c).func_111126_e())) {
this.field_70160_al = true;
float f = MathHelper.func_76133_a(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_);
@@ -1028,12 +1066,7 @@
@@ -1028,12 +1073,7 @@
} else {
BlockPos blockpos = new BlockPos(i, j, k);
IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
@@ -183,7 +222,7 @@
}
}
@@ -1053,6 +1086,9 @@
@@ -1053,6 +1093,9 @@
}
public void func_180430_e(float p_180430_1_, float p_180430_2_) {
@@ -193,7 +232,7 @@
super.func_180430_e(p_180430_1_, p_180430_2_);
PotionEffect potioneffect = this.func_70660_b(MobEffects.field_76430_j);
float f = potioneffect == null ? 0.0F : (float)(potioneffect.func_76458_c() + 1);
@@ -1065,7 +1101,7 @@
@@ -1065,7 +1108,7 @@
int l = MathHelper.func_76128_c(this.field_70161_v);
IBlockState iblockstate = this.field_70170_p.func_180495_p(new BlockPos(j, k, l));
if (!iblockstate.func_196958_f()) {
@@ -202,7 +241,7 @@
this.func_184185_a(soundtype.func_185842_g(), soundtype.func_185843_a() * 0.5F, soundtype.func_185847_b() * 0.75F);
}
}
@@ -1134,6 +1170,8 @@
@@ -1134,6 +1177,8 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -211,7 +250,7 @@
p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_);
p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_);
float f = p_70665_2_;
@@ -1144,10 +1182,11 @@
@@ -1144,10 +1189,11 @@
((EntityPlayerMP)p_70665_1_.func_76346_g()).func_195067_a(StatList.field_212735_F, Math.round(f1 * 10.0F));
}
@@ -224,7 +263,7 @@
this.func_110149_m(this.func_110139_bj() - p_70665_2_);
}
}
@@ -1189,6 +1228,8 @@
@@ -1189,6 +1235,8 @@
}
public void func_184609_a(EnumHand p_184609_1_) {
@@ -233,7 +272,7 @@
if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) {
this.field_110158_av = -1;
this.field_82175_bq = true;
@@ -1373,18 +1414,18 @@
@@ -1373,18 +1421,18 @@
double d12 = d6 + d10;
AxisAlignedBB axisalignedbb1 = axisalignedbb.func_72317_d(d9, 0.0D, d10);
if (this.field_70170_p.func_195586_b(this, axisalignedbb1)) {
@@ -255,7 +294,7 @@
d1 = d11;
d13 = this.field_70163_u + 2.0D;
d14 = d12;
@@ -1439,15 +1480,16 @@
@@ -1439,15 +1487,16 @@
}
this.field_70160_al = true;
@@ -274,7 +313,7 @@
}
protected float func_189749_co() {
@@ -1518,7 +1560,7 @@
@@ -1518,7 +1567,7 @@
try (BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185345_c(this.field_70165_t, this.func_174813_aQ().field_72338_b - 1.0D, this.field_70161_v)) {
if (this.field_70122_E) {
@@ -283,7 +322,7 @@
}
float f8 = 0.16277137F / (f7 * f7 * f7);
@@ -1532,7 +1574,7 @@
@@ -1532,7 +1581,7 @@
this.func_191958_b(p_191986_1_, p_191986_2_, p_191986_3_, f9);
f7 = 0.91F;
if (this.field_70122_E) {
@@ -292,7 +331,7 @@
}
if (this.func_70617_f_()) {
@@ -1663,6 +1705,7 @@
@@ -1663,6 +1712,7 @@
}
public void func_70071_h_() {
@@ -300,7 +339,7 @@
super.func_70071_h_();
this.func_184608_ct();
this.func_205014_p();
@@ -1694,7 +1737,9 @@
@@ -1694,7 +1744,9 @@
ItemStack itemstack1 = this.func_184582_a(entityequipmentslot);
if (!ItemStack.func_77989_b(itemstack1, itemstack)) {
@@ -310,10 +349,14 @@
if (!itemstack.func_190926_b()) {
this.func_110140_aT().func_111148_a(itemstack.func_111283_C(entityequipmentslot));
}
@@ -2134,11 +2179,18 @@
@@ -2133,12 +2185,21 @@
protected void func_184608_ct() {
if (this.func_184587_cr()) {
if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) {
- if (this.func_184586_b(this.func_184600_cs()) == this.field_184627_bm) {
+ ItemStack itemstack = this.func_184586_b(this.func_184600_cs());
+ if (net.minecraftforge.common.ForgeHooks.canContinueUsing(this.field_184627_bm, itemstack)) this.field_184627_bm = itemstack;
+ if (itemstack == this.field_184627_bm) {
+
+ if (!this.field_184627_bm.func_190926_b()) {
+ field_184628_bn = net.minecraftforge.event.ForgeEventFactory.onItemUseTick(this, field_184627_bm, field_184628_bn);
@@ -330,7 +373,7 @@
this.func_71036_o();
}
} else {
@@ -2172,8 +2224,10 @@
@@ -2172,8 +2233,10 @@
public void func_184598_c(EnumHand p_184598_1_) {
ItemStack itemstack = this.func_184586_b(p_184598_1_);
if (!itemstack.func_190926_b() && !this.func_184587_cr()) {
@@ -342,7 +385,7 @@
if (!this.field_70170_p.field_72995_K) {
this.func_204802_c(1, true);
this.func_204802_c(2, p_184598_1_ == EnumHand.OFF_HAND);
@@ -2229,6 +2283,9 @@
@@ -2229,6 +2292,9 @@
vec3d1 = vec3d1.func_178789_a(-this.field_70125_A * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_178785_b(-this.field_70177_z * ((float)Math.PI / 180F));
vec3d1 = vec3d1.func_72441_c(this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v);
@@ -352,7 +395,7 @@
this.field_70170_p.func_195594_a(new ItemParticleData(Particles.field_197591_B, p_195062_1_), vec3d1.field_72450_a, vec3d1.field_72448_b, vec3d1.field_72449_c, vec3d.field_72450_a, vec3d.field_72448_b + 0.05D, vec3d.field_72449_c);
}
@@ -2237,7 +2294,9 @@
@@ -2237,7 +2303,9 @@
protected void func_71036_o() {
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr()) {
this.func_184584_a(this.field_184627_bm, 16);
@@ -363,7 +406,7 @@
this.func_184602_cy();
}
@@ -2257,6 +2316,7 @@
@@ -2257,6 +2325,7 @@
public void func_184597_cx() {
if (!this.field_184627_bm.func_190926_b()) {
@@ -371,7 +414,7 @@
this.field_184627_bm.func_77974_b(this.field_70170_p, this, this.func_184605_cv());
}
@@ -2363,4 +2423,62 @@
@@ -2363,4 +2432,62 @@
@OnlyIn(Dist.CLIENT)
public void func_191987_a(BlockPos p_191987_1_, boolean p_191987_2_) {
}
@@ -9,7 +9,15 @@
private static final Logger field_200731_aJ = LogManager.getLogger();
public static final EntityType<EntityAreaEffectCloud> field_200788_b = func_200712_a("area_effect_cloud", EntityType.Builder.func_201757_a(EntityAreaEffectCloud.class, EntityAreaEffectCloud::new));
public static final EntityType<EntityArmorStand> field_200789_c = func_200712_a("armor_stand", EntityType.Builder.func_201757_a(EntityArmorStand.class, EntityArmorStand::new));
@@ -386,15 +386,53 @@
@@ -263,6 +263,7 @@
@Nullable
public T func_208050_a(World p_208050_1_, @Nullable NBTTagCompound p_208050_2_, @Nullable ITextComponent p_208050_3_, @Nullable EntityPlayer p_208050_4_, BlockPos p_208050_5_, boolean p_208050_6_, boolean p_208050_7_) {
T t = this.func_210761_b(p_208050_1_, p_208050_2_, p_208050_3_, p_208050_4_, p_208050_5_, p_208050_6_, p_208050_7_);
+ if (t instanceof net.minecraft.entity.EntityLiving && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((EntityLiving) t, p_208050_1_, p_208050_5_.func_177958_n(), p_208050_5_.func_177956_o(), p_208050_5_.func_177952_p(), null)) return null;
p_208050_1_.func_72838_d(t);
return t;
}
@@ -386,15 +387,53 @@
return p_200719_1_ == null ? null : p_200719_1_.func_200721_a(p_200719_0_);
}
@@ -63,7 +71,7 @@
}
public static <T extends Entity> EntityType.Builder<T> func_201757_a(Class<? extends T> p_201757_0_, Function<? super World, ? extends T> p_201757_1_) {
@@ -417,12 +455,26 @@
@@ -417,12 +456,26 @@
return this;
}
@@ -91,7 +99,7 @@
if (SharedConstants.field_206244_b) {
throw illegalstateexception;
}
@@ -431,7 +483,7 @@
@@ -431,7 +484,7 @@
}
}
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/NpcMerchant.java
+++ b/net/minecraft/entity/NpcMerchant.java
@@ -36,7 +36,7 @@
@Nullable
public MerchantRecipeList func_70934_b(EntityPlayer p_70934_1_) {
- return this.field_70936_c;
+ return net.minecraftforge.event.ForgeEventFactory.listTradeOffers(this, p_70934_1_, this.field_70936_c);
}
public void func_70930_a(@Nullable MerchantRecipeList p_70930_1_) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/ai/EntityAIAttackRangedBow.java
+++ b/net/minecraft/entity/ai/EntityAIAttackRangedBow.java
@@ -35,7 +35,7 @@
}
protected boolean func_188498_f() {
- return !this.field_188499_a.func_184614_ca().func_190926_b() && this.field_188499_a.func_184614_ca().func_77973_b() == Items.field_151031_f;
+ return !this.field_188499_a.func_184614_ca().func_190926_b() && this.field_188499_a.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ItemBow;
}
public boolean func_75253_b() {
@@ -8,7 +8,13 @@
if (!flag1 && BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(new BlockPos(this.field_70165_t, this.field_70163_u - (double)0.01F, this.field_70161_v)))) {
this.field_70122_E = false;
return;
@@ -149,7 +150,7 @@
@@ -144,12 +145,12 @@
if (iblockstate.func_177230_c() != Blocks.field_196603_bb) {
this.func_70106_y();
if (!this.field_145808_f) {
- if (iblockstate.func_185904_a().func_76222_j() && (flag1 || !BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(blockpos1.func_177977_b()))) && this.field_70170_p.func_180501_a(blockpos1, this.field_175132_d, 3)) {
+ if (iblockstate.func_185904_a().func_76222_j() && (flag1 || !BlockFalling.func_185759_i(this.field_70170_p.func_180495_p(blockpos1.func_177977_b()))) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(this, new net.minecraftforge.common.util.BlockSnapshot(func_130014_f_(), func_180425_c(), iblockstate), net.minecraft.util.EnumFacing.UP) && this.field_70170_p.func_180501_a(blockpos1, this.field_175132_d, 3)) {
if (block instanceof BlockFalling) {
((BlockFalling)block).func_176502_a_(this.field_70170_p, blockpos1, this.field_175132_d, iblockstate);
}
@@ -18,7 +18,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else {
@@ -178,6 +180,7 @@
@@ -178,12 +180,14 @@
public void func_70100_b_(EntityPlayer p_70100_1_) {
if (!this.field_70170_p.field_72995_K) {
if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) {
@@ -26,3 +26,22 @@
p_70100_1_.field_71090_bL = 2;
p_70100_1_.func_71001_a(this, 1);
ItemStack itemstack = EnchantmentHelper.func_92099_a(Enchantments.field_185296_A, p_70100_1_);
if (!itemstack.func_190926_b() && itemstack.func_77951_h()) {
- int i = Math.min(this.func_184514_c(this.field_70530_e), itemstack.func_77952_i());
- this.field_70530_e -= this.func_184515_b(i);
+ float ratio = itemstack.func_77973_b().getXpRepairRatio(itemstack);
+ int i = Math.min(roundAverage(this.field_70530_e * ratio), itemstack.func_77952_i());
+ this.field_70530_e -= roundAverage(i / ratio);
itemstack.func_196085_b(itemstack.func_77952_i() - i);
}
@@ -261,4 +265,9 @@
public boolean func_70075_an() {
return false;
}
+
+ private static int roundAverage(float value) {
+ double floor = Math.floor(value);
+ return (int) floor + (Math.random() < value - floor ? 1 : 0);
+ }
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/entity/monster/AbstractSkeleton.java
+++ b/net/minecraft/entity/monster/AbstractSkeleton.java
@@ -161,7 +161,7 @@
this.field_70714_bg.func_85156_a(this.field_85038_e);
this.field_70714_bg.func_85156_a(this.field_85037_d);
ItemStack itemstack = this.func_184614_ca();
- if (itemstack.func_77973_b() == Items.field_151031_f) {
+ if (itemstack.func_77973_b() instanceof net.minecraft.item.ItemBow) {
int i = 20;
if (this.field_70170_p.func_175659_aa() != EnumDifficulty.HARD) {
i = 40;
@@ -178,6 +178,8 @@
public void func_82196_d(EntityLivingBase p_82196_1_, float p_82196_2_) {
EntityArrow entityarrow = this.func_190726_a(p_82196_2_);
+ if (this.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ItemBow)
+ entityarrow = ((net.minecraft.item.ItemBow) this.func_184614_ca().func_77973_b()).customizeArrow(entityarrow);
double d0 = p_82196_1_.field_70165_t - this.field_70165_t;
double d1 = p_82196_1_.func_174813_aQ().field_72338_b + (double)(p_82196_1_.field_70131_O / 3.0F) - entityarrow.field_70163_u;
double d2 = p_82196_1_.field_70161_v - this.field_70161_v;
@@ -20,6 +20,15 @@
return false;
} else {
return this.field_179475_a.func_70681_au().nextInt(2000) == 0;
@@ -373,7 +375,7 @@
IBlockState iblockstate = iworld.func_180495_p(blockpos);
IBlockState iblockstate1 = iworld.func_180495_p(blockpos.func_177977_b());
IBlockState iblockstate2 = this.field_179475_a.func_195405_dq();
- if (iblockstate2 != null && this.func_195924_a(iworld, blockpos, iblockstate2, iblockstate, iblockstate1)) {
+ if (iblockstate2 != null && this.func_195924_a(iworld, blockpos, iblockstate2, iblockstate, iblockstate1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(field_179475_a, new net.minecraftforge.common.util.BlockSnapshot(field_179475_a.field_70170_p, blockpos, iblockstate), net.minecraft.util.EnumFacing.UP)) {
iworld.func_180501_a(blockpos, iblockstate2, 3);
this.field_179475_a.func_195406_b((IBlockState)null);
}
@@ -395,7 +397,7 @@
public boolean func_75250_a() {
if (this.field_179473_a.func_195405_dq() != null) {
@@ -0,0 +1,11 @@
--- a/net/minecraft/entity/monster/EntityIllusionIllager.java
+++ b/net/minecraft/entity/monster/EntityIllusionIllager.java
@@ -181,6 +181,8 @@
public void func_82196_d(EntityLivingBase p_82196_1_, float p_82196_2_) {
EntityArrow entityarrow = this.func_193097_t(p_82196_2_);
+ if (this.func_184614_ca().func_77973_b() instanceof net.minecraft.item.ItemBow)
+ entityarrow = ((net.minecraft.item.ItemBow) this.func_184614_ca().func_77973_b()).customizeArrow(entityarrow);
double d0 = p_82196_1_.field_70165_t - this.field_70165_t;
double d1 = p_82196_1_.func_174813_aQ().field_72338_b + (double)(p_82196_1_.field_70131_O / 3.0F) - entityarrow.field_70163_u;
double d2 = p_82196_1_.field_70161_v - this.field_70161_v;
@@ -0,0 +1,16 @@
--- a/net/minecraft/entity/monster/EntitySpider.java
+++ b/net/minecraft/entity/monster/EntitySpider.java
@@ -120,7 +120,12 @@
}
public boolean func_70687_e(PotionEffect p_70687_1_) {
- return p_70687_1_.func_188419_a() == MobEffects.field_76436_u ? false : super.func_70687_e(p_70687_1_);
+ if (p_70687_1_.func_188419_a() == MobEffects.field_76436_u) {
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, p_70687_1_);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ return event.getResult() == net.minecraftforge.eventbus.api.Event.Result.ALLOW;
+ }
+ return super.func_70687_e(p_70687_1_);
}
public boolean func_70841_p() {
@@ -32,6 +32,15 @@
if (p_70037_1_.func_150297_b("ConversionTime", 99) && p_70037_1_.func_74762_e("ConversionTime") > -1) {
this.func_191991_a(p_70037_1_.func_186855_b("ConversionPlayer") ? p_70037_1_.func_186857_a("ConversionPlayer") : null, p_70037_1_.func_74762_e("ConversionTime"));
}
@@ -76,7 +84,7 @@
@Nullable
public IEntityLivingData func_204210_a(DifficultyInstance p_204210_1_, @Nullable IEntityLivingData p_204210_2_, @Nullable NBTTagCompound p_204210_3_) {
- this.func_190733_a(this.field_70170_p.field_73012_v.nextInt(6));
+ net.minecraftforge.fml.common.registry.VillagerRegistry.setRandomProfession(this, this.field_70170_p.field_73012_v);
return super.func_204210_a(p_204210_1_, p_204210_2_, p_204210_3_);
}
@@ -145,7 +153,7 @@
protected void func_190738_dp() {
EntityVillager entityvillager = new EntityVillager(this.field_70170_p);
@@ -121,7 +121,12 @@
} else {
this.field_82189_bL = null;
}
@@ -473,11 +512,10 @@
@@ -469,15 +508,14 @@
this.func_175554_cu();
}
- return this.field_70963_i;
+ return net.minecraftforge.event.ForgeEventFactory.listTradeOffers(this, p_70934_1_, field_70963_i);
}
private void func_175554_cu() {
@@ -140,7 +140,7 @@
}
public void func_70037_a(NBTTagCompound p_70037_1_) {
@@ -740,6 +765,14 @@
@@ -740,6 +765,17 @@
this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced");
}
@@ -148,14 +148,17 @@
+ NBTTagCompound data = (NBTTagCompound)e;
+ ResourceLocation dim = new ResourceLocation(data.func_74779_i("Dim"));
+ this.spawnPosMap.put(dim, new BlockPos(data.func_74762_e("SpawnX"), data.func_74762_e("SpawnY"), data.func_74762_e("SpawnZ")));
+ this.spawnForcedMap.put(dim, data.func_74767_n("DpawnForced"));
+ this.spawnForcedMap.put(dim, data.func_74767_n("SpawnForced"));
+ });
+ this.spawnDimension = net.minecraft.world.dimension.DimensionType.func_186069_a(p_70037_1_.func_150297_b("SpawnDimension", 99) ? p_70037_1_.func_74762_e("SpawnDimension") : 0);
+ net.minecraft.world.dimension.DimensionType spawnDim = null;
+ if (p_70037_1_.func_150297_b("SpawnDimension", net.minecraftforge.common.util.Constants.NBT.TAG_STRING))
+ spawnDim = net.minecraft.world.dimension.DimensionType.func_193417_a(new ResourceLocation(p_70037_1_.func_74779_i("SpawnDimension")));
+ this.spawnDimension = spawnDim != null ? spawnDim : net.minecraft.world.dimension.DimensionType.OVERWORLD;
+
this.field_71100_bB.func_75112_a(p_70037_1_);
this.field_71075_bZ.func_75095_b(p_70037_1_);
if (p_70037_1_.func_150297_b("EnderItems", 9)) {
@@ -786,9 +819,26 @@
@@ -786,9 +822,26 @@
p_70014_1_.func_74782_a("ShoulderEntityRight", this.func_192025_dl());
}
@@ -173,7 +176,7 @@
+ });
+ p_70014_1_.func_74782_a("Spawns", spawnlist);
+ if (spawnDimension != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ p_70014_1_.func_74768_a("SpawnDimension", spawnDimension.func_186068_a());
+ p_70014_1_.func_74778_a("SpawnDimension", spawnDimension.getRegistryName().toString());
+ }
}
@@ -182,7 +185,7 @@
if (this.func_180431_b(p_70097_1_)) {
return false;
} else if (this.field_71075_bZ.field_75102_a && !p_70097_1_.func_76357_e()) {
@@ -824,7 +874,7 @@
@@ -824,7 +877,7 @@
protected void func_190629_c(EntityLivingBase p_190629_1_) {
super.func_190629_c(p_190629_1_);
@@ -191,7 +194,7 @@
this.func_190777_m(true);
}
@@ -845,11 +895,13 @@
@@ -845,11 +898,13 @@
}
protected void func_184590_k(float p_184590_1_) {
@@ -206,7 +209,7 @@
if (enumhand == EnumHand.MAIN_HAND) {
this.func_184201_a(EntityEquipmentSlot.MAINHAND, ItemStack.field_190927_a);
} else {
@@ -877,11 +929,14 @@
@@ -877,11 +932,14 @@
protected void func_70665_d(DamageSource p_70665_1_, float p_70665_2_) {
if (!this.func_180431_b(p_70665_1_)) {
@@ -221,7 +224,7 @@
float f1 = f - p_70665_2_;
if (f1 > 0.0F && f1 < 3.4028235E37F) {
this.func_195067_a(StatList.field_212738_J, Math.round(f1 * 10.0F));
@@ -935,6 +990,8 @@
@@ -935,6 +993,8 @@
return EnumActionResult.PASS;
} else {
@@ -230,7 +233,7 @@
ItemStack itemstack = this.func_184586_b(p_190775_2_);
ItemStack itemstack1 = itemstack.func_190926_b() ? ItemStack.field_190927_a : itemstack.func_77946_l();
if (p_190775_1_.func_184230_a(this, p_190775_2_)) {
@@ -942,6 +999,10 @@
@@ -942,6 +1002,10 @@
itemstack.func_190920_e(itemstack1.func_190916_E());
}
@@ -241,7 +244,7 @@
return EnumActionResult.SUCCESS;
} else {
if (!itemstack.func_190926_b() && p_190775_1_ instanceof EntityLivingBase) {
@@ -951,6 +1012,7 @@
@@ -951,6 +1015,7 @@
if (itemstack.func_111282_a(this, (EntityLivingBase)p_190775_1_, p_190775_2_)) {
if (itemstack.func_190926_b() && !this.field_71075_bZ.field_75098_d) {
@@ -249,7 +252,7 @@
this.func_184611_a(p_190775_2_, ItemStack.field_190927_a);
}
@@ -973,6 +1035,7 @@
@@ -973,6 +1038,7 @@
}
public void func_71059_n(Entity p_71059_1_) {
@@ -257,7 +260,7 @@
if (p_71059_1_.func_70075_an()) {
if (!p_71059_1_.func_85031_j(this)) {
float f = (float)this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111126_e();
@@ -1000,8 +1063,11 @@
@@ -1000,8 +1066,11 @@
boolean flag2 = flag && this.field_70143_R > 0.0F && !this.field_70122_E && !this.func_70617_f_() && !this.func_70090_H() && !this.func_70644_a(MobEffects.field_76440_q) && !this.func_184218_aH() && p_71059_1_ instanceof EntityLivingBase;
flag2 = flag2 && !this.func_70051_ag();
@@ -270,7 +273,7 @@
}
f = f + f1;
@@ -1097,8 +1163,10 @@
@@ -1097,8 +1166,10 @@
}
if (!itemstack1.func_190926_b() && entity instanceof EntityLivingBase) {
@@ -281,7 +284,7 @@
this.func_184611_a(EnumHand.MAIN_HAND, ItemStack.field_190927_a);
}
}
@@ -1140,7 +1208,7 @@
@@ -1140,7 +1211,7 @@
}
if (this.field_70146_Z.nextFloat() < f) {
@@ -290,7 +293,7 @@
this.func_184602_cy();
this.field_70170_p.func_72960_a(this, (byte)30);
}
@@ -1188,7 +1256,11 @@
@@ -1188,7 +1259,11 @@
}
public EntityPlayer.SleepResult func_180469_a(BlockPos p_180469_1_) {
@@ -303,16 +306,16 @@
if (!this.field_70170_p.field_72995_K) {
if (this.func_70608_bn() || !this.func_70089_S()) {
return EntityPlayer.SleepResult.OTHER_PROBLEM;
@@ -1198,7 +1270,7 @@
@@ -1198,7 +1273,7 @@
return EntityPlayer.SleepResult.NOT_POSSIBLE_HERE;
}
- if (this.field_70170_p.func_72935_r()) {
+ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, this.field_71081_bT)) {
+ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, p_180469_1_)) {
return EntityPlayer.SleepResult.NOT_POSSIBLE_NOW;
}
@@ -1223,7 +1295,7 @@
@@ -1223,7 +1298,7 @@
this.func_192030_dh();
this.func_175145_a(StatList.field_199092_j.func_199076_b(StatList.field_203284_n));
this.func_70105_a(0.2F, 0.2F);
@@ -321,7 +324,7 @@
float f1 = 0.5F + (float)enumfacing.func_82601_c() * 0.4F;
float f = 0.5F + (float)enumfacing.func_82599_e() * 0.4F;
this.func_175139_a(enumfacing);
@@ -1248,6 +1320,8 @@
@@ -1248,6 +1323,8 @@
private boolean func_190774_a(BlockPos p_190774_1_, EnumFacing p_190774_2_) {
if (Math.abs(this.field_70165_t - (double)p_190774_1_.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)p_190774_1_.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)p_190774_1_.func_177952_p()) <= 3.0D) {
return true;
@@ -330,7 +333,7 @@
} else {
BlockPos blockpos = p_190774_1_.func_177972_a(p_190774_2_.func_176734_d());
return Math.abs(this.field_70165_t - (double)blockpos.func_177958_n()) <= 3.0D && Math.abs(this.field_70163_u - (double)blockpos.func_177956_o()) <= 2.0D && Math.abs(this.field_70161_v - (double)blockpos.func_177952_p()) <= 3.0D;
@@ -1260,16 +1334,19 @@
@@ -1260,16 +1337,19 @@
}
public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) {
@@ -354,7 +357,7 @@
}
this.field_71083_bS = false;
@@ -1285,29 +1362,30 @@
@@ -1285,29 +1365,30 @@
}
private boolean func_175143_p() {
@@ -391,7 +394,7 @@
switch(enumfacing) {
case SOUTH:
return 90.0F;
@@ -1339,23 +1417,67 @@
@@ -1339,23 +1420,67 @@
public void func_146105_b(ITextComponent p_146105_1_, boolean p_146105_2_) {
}
@@ -403,11 +406,11 @@
+ /**
+ * A dimension aware version of getBedLocation.
+ * @param dimension The dimension to get the bed spawn for
+ * @param dim The dimension to get the bed spawn for
+ * @return The player specific spawn location for the dimension. May be null.
+ */
+ public BlockPos getBedLocation(net.minecraft.world.dimension.DimensionType dim) {
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_71081_bT : spawnPosMap.get(dim);
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_71081_bT : spawnPosMap.get(dim.getRegistryName());
+ }
+
+ @Deprecated //Forge: Use Dimension sensitive version
@@ -420,11 +423,11 @@
+ * A dimension aware version of isSpawnForced.
+ * Noramally isSpawnForced is used to determine if the respawn system should check for a bed or not.
+ * This just extends that to be dimension aware.
+ * @param dimension The dimension to get whether to check for a bed before spawning for
+ * @param dim The dimension to get whether to check for a bed before spawning for
+ * @return The player specific spawn location for the dimension. May be null.
+ */
+ public boolean isSpawnForced(net.minecraft.world.dimension.DimensionType dim) {
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim, false);
+ return dim == net.minecraft.world.dimension.DimensionType.OVERWORLD ? field_82248_d : spawnForcedMap.getOrDefault(dim.getRegistryName(), false);
+ }
+
+ @Deprecated //Forge: Use Dimension sensitive version
@@ -444,9 +447,9 @@
+ * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension.
+ * @param pos The spawn point to set as the player-specific spawn point for the dimension
+ * @param forced Whether or not the respawn code should check for a bed at this location (true means it won't check for a bed)
+ * @param dimension Which dimension to apply the player-specific respawn point to
+ * @param dim Which dimension to apply the player-specific respawn point to
+ */
+ public void setSpawnPoint(BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) {
+ public void setSpawnPoint(@Nullable BlockPos pos, boolean forced, net.minecraft.world.dimension.DimensionType dim) {
+ if(net.minecraftforge.event.ForgeEventFactory.onPlayerSpawnSet(this, pos, forced)) return;
+ if (dim != net.minecraft.world.dimension.DimensionType.OVERWORLD) {
+ if (pos == null) {
@@ -468,7 +471,7 @@
}
public void func_195066_a(ResourceLocation p_195066_1_) {
@@ -1525,6 +1647,8 @@
@@ -1525,6 +1650,8 @@
}
super.func_180430_e(p_180430_1_, p_180430_2_);
@@ -477,7 +480,7 @@
}
}
@@ -1786,7 +1910,10 @@
@@ -1786,7 +1913,10 @@
}
public ITextComponent func_145748_c_() {
@@ -489,7 +492,7 @@
return this.func_208016_c(itextcomponent);
}
@@ -1806,7 +1933,7 @@
@@ -1806,7 +1936,7 @@
}
public float func_70047_e() {
@@ -498,7 +501,7 @@
if (this.func_70608_bn()) {
f = 0.2F;
} else if (!this.func_203007_ba() && !this.func_184613_cA() && this.field_70131_O != 0.6F) {
@@ -1973,6 +2100,54 @@
@@ -1973,6 +2103,54 @@
return this.field_71075_bZ.field_75098_d && this.func_184840_I() >= 2;
}
@@ -119,9 +119,16 @@
}
protected void func_70670_a(PotionEffect p_70670_1_) {
@@ -1179,8 +1203,8 @@
@@ -1174,13 +1198,13 @@
this.func_184210_p();
if (p_200619_1_ == this.field_70170_p) {
this.field_71135_a.func_147364_a(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
- } else {
+ } else if (net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_200619_1_.field_73011_w.func_186058_p())) {
WorldServer worldserver = this.func_71121_q();
this.field_71093_bK = p_200619_1_.field_73011_w.func_186058_p();
this.field_71135_a.func_147359_a(new SPacketRespawn(this.field_71093_bK, worldserver.func_175659_aa(), worldserver.func_72912_H().func_76067_t(), this.field_71134_c.func_73081_b()));
- this.field_71135_a.func_147359_a(new SPacketRespawn(this.field_71093_bK, worldserver.func_175659_aa(), worldserver.func_72912_H().func_76067_t(), this.field_71134_c.func_73081_b()));
+ this.field_71135_a.func_147359_a(new SPacketRespawn(this.field_71093_bK, p_200619_1_.func_175659_aa(), p_200619_1_.func_72912_H().func_76067_t(), this.field_71134_c.func_73081_b())); // Forge: Use new dimensions information
this.field_71133_b.func_184103_al().func_187243_f(this);
- worldserver.func_72973_f(this);
- this.field_70128_L = false;
@@ -130,3 +137,11 @@
this.func_70012_b(p_200619_2_, p_200619_4_, p_200619_6_, p_200619_8_, p_200619_9_);
if (this.func_70089_S()) {
worldserver.func_72866_a(this, false);
@@ -1194,6 +1218,7 @@
this.field_71134_c.func_73080_a(p_200619_1_);
this.field_71133_b.func_184103_al().func_72354_b(this, p_200619_1_);
this.field_71133_b.func_184103_al().func_72385_f(this);
+ net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerChangedDimensionEvent(this, p_200619_1_.field_73011_w.func_186058_p(), this.field_71093_bK);
}
}
@@ -0,0 +1,20 @@
--- a/net/minecraft/item/EnumRarity.java
+++ b/net/minecraft/item/EnumRarity.java
@@ -2,7 +2,7 @@
import net.minecraft.util.text.TextFormatting;
-public enum EnumRarity {
+public enum EnumRarity implements net.minecraftforge.common.IExtensibleEnum {
COMMON(TextFormatting.WHITE),
UNCOMMON(TextFormatting.YELLOW),
RARE(TextFormatting.AQUA),
@@ -13,4 +13,8 @@
private EnumRarity(TextFormatting p_i48837_3_) {
this.field_77937_e = p_i48837_3_;
}
+
+ public static EnumRarity create(String enumName, TextFormatting p_i48837_3_) {
+ throw new IllegalStateException("Enum not extended");
+ }
}
@@ -1,6 +1,15 @@
--- a/net/minecraft/item/ItemBow.java
+++ b/net/minecraft/item/ItemBow.java
@@ -56,15 +56,19 @@
@@ -22,7 +22,7 @@
if (p_210310_2_ == null) {
return 0.0F;
} else {
- return p_210310_2_.func_184607_cu().func_77973_b() != Items.field_151031_f ? 0.0F : (float)(p_210310_0_.func_77988_m() - p_210310_2_.func_184605_cv()) / 20.0F;
+ return !(p_210310_2_.func_184607_cu().func_77973_b() instanceof ItemBow) ? 0.0F : (float)(p_210310_0_.func_77988_m() - p_210310_2_.func_184605_cv()) / 20.0F;
}
});
this.func_185043_a(new ResourceLocation("pulling"), (p_210309_0_, p_210309_1_, p_210309_2_) -> {
@@ -56,18 +56,23 @@
EntityPlayer entityplayer = (EntityPlayer)p_77615_3_;
boolean flag = entityplayer.field_71075_bZ.field_75098_d || EnchantmentHelper.func_77506_a(Enchantments.field_185312_x, p_77615_1_) > 0;
ItemStack itemstack = this.func_185060_a(entityplayer);
@@ -22,7 +31,11 @@
if (!p_77615_2_.field_72995_K) {
ItemArrow itemarrow = (ItemArrow)(itemstack.func_77973_b() instanceof ItemArrow ? itemstack.func_77973_b() : Items.field_151032_g);
EntityArrow entityarrow = itemarrow.func_200887_a(p_77615_2_, itemstack, entityplayer);
@@ -130,6 +134,10 @@
+ entityarrow = this.customizeArrow(entityarrow);
entityarrow.func_184547_a(entityplayer, entityplayer.field_70125_A, entityplayer.field_70177_z, 0.0F, f * 3.0F, 1.0F);
if (f == 1.0F) {
entityarrow.func_70243_d(true);
@@ -130,6 +135,10 @@
public ActionResult<ItemStack> func_77659_a(World p_77659_1_, EntityPlayer p_77659_2_, EnumHand p_77659_3_) {
ItemStack itemstack = p_77659_2_.func_184586_b(p_77659_3_);
boolean flag = !this.func_185060_a(p_77659_2_).func_190926_b();
@@ -33,3 +46,12 @@
if (!p_77659_2_.field_71075_bZ.field_75098_d && !flag) {
return flag ? new ActionResult<>(EnumActionResult.PASS, itemstack) : new ActionResult<>(EnumActionResult.FAIL, itemstack);
} else {
@@ -141,4 +150,8 @@
public int func_77619_b() {
return 1;
}
+
+ public EntityArrow customizeArrow(EntityArrow arrow) {
+ return arrow;
+ }
}
@@ -8,7 +8,7 @@
+ // special case for handling block placement with water lilies
+ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_1_, blockpos1);
p_77659_1_.func_180501_a(blockpos1, Blocks.field_196651_dG.func_176223_P(), 11);
+ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(p_77659_2_, blocksnapshot, net.minecraft.util.EnumFacing.UP, p_77659_3_).isCanceled()) {
+ if (net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_77659_2_, blocksnapshot, net.minecraft.util.EnumFacing.UP)) {
+ blocksnapshot.restore(true, false);
+ return new ActionResult<ItemStack>(EnumActionResult.FAIL, itemstack);
+ }
@@ -74,6 +74,7 @@
- BlockPos blockpos = p_196084_1_.func_195995_a();
- BlockWorldState blockworldstate = new BlockWorldState(p_196084_1_.func_195991_k(), blockpos, false);
- if (entityplayer != null && !entityplayer.field_71075_bZ.field_75099_e && !this.func_206847_b(p_196084_1_.func_195991_k().func_205772_D(), blockworldstate)) {
+ if (!p_196084_1_.field_196006_g.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(p_196084_1_);
+ return onItemUse(p_196084_1_, (c) -> func_77973_b().func_195939_a(p_196084_1_));
+ }
+
@@ -82,7 +83,6 @@
+ }
+
+ private EnumActionResult onItemUse(ItemUseContext context, java.util.function.Function<ItemUseContext, EnumActionResult> callback) {
+ //if (!context.world.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(context);
+ EntityPlayer entityplayer = context.func_195999_j();
+ BlockPos blockpos = context.func_195995_a();
+ BlockWorldState blockworldstate = new BlockWorldState(context.func_195991_k(), blockpos, false);
@@ -89,7 +89,13 @@
}
if (i > 0 && astring[0].length() != s.length()) {
@@ -258,6 +277,7 @@
@@ -253,11 +272,12 @@
throw new JsonParseException("Disallowed data tag found");
} else {
int i = JsonUtils.func_151208_a(p_199798_0_, "count", 1);
- return new ItemStack(item, i);
+ return net.minecraftforge.common.crafting.CraftingHelper.getItemStack(p_199798_0_, true);
}
}
public static class Serializer implements IRecipeSerializer<ShapedRecipe> {
@@ -1,6 +1,14 @@
--- a/net/minecraft/nbt/NBTTagCompound.java
+++ b/net/minecraft/nbt/NBTTagCompound.java
@@ -389,6 +389,7 @@
@@ -71,6 +71,7 @@
}
public void func_74782_a(String p_74782_1_, INBTBase p_74782_2_) {
+ if (p_74782_2_ == null) throw new IllegalArgumentException("Invalid null NBT value with key " + p_74782_1_);
this.field_74784_a.put(p_74782_1_, p_74782_2_);
}
@@ -389,6 +390,7 @@
}
private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException {
@@ -8,7 +16,7 @@
return p_152447_0_.readByte();
}
@@ -397,6 +398,7 @@
@@ -397,6 +399,7 @@
}
static INBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) throws IOException {
@@ -0,0 +1,22 @@
--- a/net/minecraft/network/datasync/DataSerializers.java
+++ b/net/minecraft/network/datasync/DataSerializers.java
@@ -320,16 +320,16 @@
};
public static void func_187189_a(DataSerializer<?> p_187189_0_) {
- field_187204_n.func_186808_c(p_187189_0_);
+ if (field_187204_n.func_186808_c(p_187189_0_) >= 256) throw new RuntimeException("Vanilla DataSerializer ID limit exceeded");
}
@Nullable
public static DataSerializer<?> func_187190_a(int p_187190_0_) {
- return field_187204_n.func_186813_a(p_187190_0_);
+ return net.minecraftforge.common.ForgeHooks.getSerializer(p_187190_0_, field_187204_n);
}
public static int func_187188_b(DataSerializer<?> p_187188_0_) {
- return field_187204_n.func_186815_a(p_187188_0_);
+ return net.minecraftforge.common.ForgeHooks.getSerializerId(p_187188_0_, field_187204_n);
}
static {
@@ -0,0 +1,18 @@
--- a/net/minecraft/network/datasync/EntityDataManager.java
+++ b/net/minecraft/network/datasync/EntityDataManager.java
@@ -35,11 +35,13 @@
}
public static <T> DataParameter<T> func_187226_a(Class<? extends Entity> p_187226_0_, DataSerializer<T> p_187226_1_) {
- if (field_190303_a.isDebugEnabled()) {
+ if (true || field_190303_a.isDebugEnabled()) { // Forge: This is very useful for mods that register keys on classes that are not their own
try {
Class<?> oclass = Class.forName(Thread.currentThread().getStackTrace()[2].getClassName());
if (!oclass.equals(p_187226_0_)) {
- field_190303_a.debug("defineId called for: {} from {}", p_187226_0_, oclass, new RuntimeException());
+ // Forge: log at warn, mods should not add to classes that they don't own, and only add stacktrace when in debug is enabled as it is mostly not needed and consumes time
+ if (field_190303_a.isDebugEnabled()) field_190303_a.warn("defineId called for: {} from {}", p_187226_0_, oclass, new RuntimeException());
+ else field_190303_a.warn("defineId called for: {} from {}", p_187226_0_, oclass);
}
} catch (ClassNotFoundException var5) {
;
@@ -0,0 +1,21 @@
--- a/net/minecraft/pathfinding/FlyingNodeProcessor.java
+++ b/net/minecraft/pathfinding/FlyingNodeProcessor.java
@@ -206,7 +206,9 @@
EnumSet<PathNodeType> enumset = EnumSet.noneOf(PathNodeType.class);
PathNodeType pathnodetype = PathNodeType.BLOCKED;
BlockPos blockpos = new BlockPos(p_186319_5_);
+ this.currentEntity = p_186319_5_;
pathnodetype = this.func_193577_a(p_186319_1_, p_186319_2_, p_186319_3_, p_186319_4_, p_186319_6_, p_186319_7_, p_186319_8_, p_186319_9_, p_186319_10_, enumset, pathnodetype, blockpos);
+ this.currentEntity = null;
if (enumset.contains(PathNodeType.FENCE)) {
return PathNodeType.FENCE;
} else {
@@ -238,6 +240,8 @@
if (pathnodetype1 != PathNodeType.DAMAGE_FIRE && block != Blocks.field_196814_hQ && pathnodetype1 != PathNodeType.LAVA) {
if (pathnodetype1 == PathNodeType.DAMAGE_CACTUS) {
pathnodetype = PathNodeType.DAMAGE_CACTUS;
+ } else if (pathnodetype1 == PathNodeType.DAMAGE_OTHER) { // Forge: consider modded damage types
+ pathnodetype = PathNodeType.DAMAGE_OTHER;
} else {
pathnodetype = pathnodetype1 != PathNodeType.WALKABLE && pathnodetype1 != PathNodeType.OPEN && pathnodetype1 != PathNodeType.WATER ? PathNodeType.WALKABLE : PathNodeType.OPEN;
}
@@ -1,24 +1,55 @@
--- a/net/minecraft/pathfinding/WalkNodeProcessor.java
+++ b/net/minecraft/pathfinding/WalkNodeProcessor.java
@@ -343,10 +343,11 @@
@@ -27,6 +27,7 @@
public class WalkNodeProcessor extends NodeProcessor {
protected float field_176183_h;
+ protected EntityLiving currentEntity;
public void func_186315_a(IBlockReader p_186315_1_, EntityLiving p_186315_2_) {
super.func_186315_a(p_186315_1_, p_186315_2_);
@@ -254,7 +255,9 @@
PathNodeType pathnodetype = PathNodeType.BLOCKED;
double d0 = (double)p_186319_5_.field_70130_N / 2.0D;
BlockPos blockpos = new BlockPos(p_186319_5_);
+ this.currentEntity = p_186319_5_;
pathnodetype = this.func_193577_a(p_186319_1_, p_186319_2_, p_186319_3_, p_186319_4_, p_186319_6_, p_186319_7_, p_186319_8_, p_186319_9_, p_186319_10_, enumset, pathnodetype, blockpos);
+ this.currentEntity = p_186319_5_;
if (enumset.contains(PathNodeType.FENCE)) {
return PathNodeType.FENCE;
} else {
@@ -331,6 +334,7 @@
if (pathnodetype1 == PathNodeType.DAMAGE_CACTUS) {
pathnodetype = PathNodeType.DAMAGE_CACTUS;
}
+ if (pathnodetype1 == PathNodeType.DAMAGE_OTHER) pathnodetype = PathNodeType.DAMAGE_OTHER; // Forge: consider modded damage types
}
pathnodetype = this.func_193578_a(p_186330_1_, p_186330_2_, p_186330_3_, p_186330_4_, pathnodetype);
@@ -343,11 +347,15 @@
for(int i = -1; i <= 1; ++i) {
for(int j = -1; j <= 1; ++j) {
if (i != 0 || j != 0) {
- Block block = p_193578_1_.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(i + p_193578_2_, p_193578_3_, j + p_193578_4_)).func_177230_c();
- if (block == Blocks.field_150434_aF) {
+ IBlockState state = p_193578_1_.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(i + p_193578_2_, p_193578_3_, j + p_193578_4_));
+ Block block = state.func_177230_c();
if (block == Blocks.field_150434_aF) {
+ PathNodeType type = block.getAiPathNodeType(state, p_193578_1_, blockpos$pooledmutableblockpos, this.currentEntity);
+ if (block == Blocks.field_150434_aF || type == PathNodeType.DAMAGE_CACTUS) {
p_193578_5_ = PathNodeType.DANGER_CACTUS;
- } else if (block == Blocks.field_150480_ab) {
+ } else if (block == Blocks.field_150480_ab || state.isBurning(p_193578_1_, blockpos$pooledmutableblockpos)) {
+ } else if (block == Blocks.field_150480_ab || type == PathNodeType.DAMAGE_FIRE) {
p_193578_5_ = PathNodeType.DANGER_FIRE;
+ } else if (type == PathNodeType.DAMAGE_OTHER) {
+ p_193578_5_ = PathNodeType.DAMAGE_OTHER;
}
}
@@ -361,9 +362,11 @@
}
@@ -361,9 +369,11 @@
protected PathNodeType func_189553_b(IBlockReader p_189553_1_, int p_189553_2_, int p_189553_3_, int p_189553_4_) {
BlockPos blockpos = new BlockPos(p_189553_2_, p_189553_3_, p_189553_4_);
IBlockState iblockstate = p_189553_1_.func_180495_p(blockpos);
+ PathNodeType type = iblockstate.getAiPathNodeType(p_189553_1_, blockpos);
+ PathNodeType type = iblockstate.getAiPathNodeType(p_189553_1_, blockpos, this.currentEntity);
+ if (type != null) return type;
Block block = iblockstate.func_177230_c();
Material material = iblockstate.func_185904_a();
@@ -17,7 +17,7 @@
public boolean func_76398_f() {
return this.field_76418_K;
}
@@ -258,4 +257,70 @@
@@ -258,4 +257,73 @@
private static void func_210759_a(int p_210759_0_, String p_210759_1_, Potion p_210759_2_) {
IRegistry.field_212631_t.func_177775_a(p_210759_0_, new ResourceLocation(p_210759_1_), p_210759_2_);
}
@@ -46,25 +46,28 @@
+ /**
+ * Called to draw the this Potion onto the player's inventory when it's active.
+ * This can be used to e.g. render Potion icons from your own texture.
+ *
+ * @param effect the active PotionEffect
+ * @param gui the gui instance
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @param effect the active PotionEffect
+ * @param mc the Minecraft instance, for convenience
+ * @param z the z level
+ */
+ @OnlyIn(Dist.CLIENT)
+ public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { }
+ public void renderInventoryEffect(PotionEffect effect, net.minecraft.client.gui.Gui gui, int x, int y, float z) { }
+
+ /**
+ * Called to draw the this Potion onto the player's ingame HUD when it's active.
+ * This can be used to e.g. render Potion icons from your own texture.
+ * @param effect the active PotionEffect
+ * @param gui the gui instance
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @param effect the active PotionEffect
+ * @param mc the Minecraft instance, for convenience
+ * @param z the z level
+ * @param alpha the alpha value, blinks when the potion is about to run out
+ */
+ @OnlyIn(Dist.CLIENT)
+ public void renderHUDEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc, float alpha) { }
+ public void renderHUDEffect(PotionEffect effect, net.minecraft.client.gui.Gui gui, int x, int y, float z, float alpha) { }
+
+ /**
+ * Get a fresh list of items that can cure this Potion.
@@ -17,7 +17,18 @@
}
public boolean func_199308_a(PotionEffect p_199308_1_) {
@@ -188,11 +191,12 @@
@@ -88,6 +91,10 @@
}
public Potion func_188419_a() {
+ return this.getPotionRaw() == null ? null : this.getPotionRaw().delegate.get();
+ }
+
+ private Potion getPotionRaw() {
return this.field_188420_b;
}
@@ -188,11 +195,12 @@
p_82719_1_.func_74757_a("Ambient", this.func_82720_e());
p_82719_1_.func_74757_a("ShowParticles", this.func_188418_e());
p_82719_1_.func_74757_a("ShowIcon", this.func_205348_f());
@@ -31,7 +42,7 @@
Potion potion = Potion.func_188412_a(i);
if (potion == null) {
return null;
@@ -210,7 +214,7 @@
@@ -210,7 +218,7 @@
flag2 = p_82722_0_.func_74767_n("ShowIcon");
}
@@ -40,7 +51,7 @@
}
}
@@ -226,6 +230,67 @@
@@ -226,6 +234,67 @@
public int compareTo(PotionEffect p_compareTo_1_) {
int i = 32147;
@@ -82,23 +82,25 @@
p_72368_1_.func_71121_q().func_73039_n().func_72790_b(p_72368_1_);
p_72368_1_.func_71121_q().func_184164_w().func_72695_c(p_72368_1_);
this.field_72404_b.remove(p_72368_1_);
this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK).func_72973_f(p_72368_1_);
- this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK).func_72973_f(p_72368_1_);
- BlockPos blockpos = p_72368_1_.func_180470_cg();
- boolean flag = p_72368_1_.func_82245_bX();
+ this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK).removeEntityDangerously(p_72368_1_, true); // Forge: keep data until copyFrom called
+ BlockPos blockpos = p_72368_1_.getBedLocation(p_72368_2_);
+ boolean flag = p_72368_1_.isSpawnForced(p_72368_2_);
p_72368_1_.field_71093_bK = p_72368_2_;
PlayerInteractionManager playerinteractionmanager;
if (this.field_72400_f.func_71242_L()) {
@@ -409,6 +432,7 @@
@@ -409,6 +432,8 @@
EntityPlayerMP entityplayermp = new EntityPlayerMP(this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), playerinteractionmanager);
entityplayermp.field_71135_a = p_72368_1_.field_71135_a;
entityplayermp.func_193104_a(p_72368_1_, p_72368_3_);
+ p_72368_1_.remove(false); // Forge: clone event had a chance to see old data, now discard it
+ entityplayermp.field_71093_bK = p_72368_2_;
entityplayermp.func_145769_d(p_72368_1_.func_145782_y());
entityplayermp.func_184819_a(p_72368_1_.func_184591_cq());
@@ -422,7 +446,7 @@
@@ -422,7 +447,7 @@
BlockPos blockpos1 = EntityPlayer.func_180467_a(this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), blockpos, flag);
if (blockpos1 != null) {
entityplayermp.func_70012_b((double)((float)blockpos1.func_177958_n() + 0.5F), (double)((float)blockpos1.func_177956_o() + 0.1F), (double)((float)blockpos1.func_177952_p() + 0.5F), 0.0F, 0.0F);
@@ -107,7 +109,16 @@
} else {
entityplayermp.field_71135_a.func_147359_a(new SPacketChangeGameState(0, 0.0F));
}
@@ -447,6 +471,7 @@
@@ -434,7 +459,7 @@
entityplayermp.func_70107_b(entityplayermp.field_70165_t, entityplayermp.field_70163_u + 1.0D, entityplayermp.field_70161_v);
}
- entityplayermp.field_71135_a.func_147359_a(new SPacketRespawn(entityplayermp.field_71093_bK, entityplayermp.field_70170_p.func_175659_aa(), entityplayermp.field_70170_p.func_72912_H().func_76067_t(), entityplayermp.field_71134_c.func_73081_b()));
+ entityplayermp.field_71135_a.func_147359_a(new SPacketRespawn(entityplayermp.field_71093_bK, world.func_175659_aa(), world.func_72912_H().func_76067_t(), entityplayermp.field_71134_c.func_73081_b())); // Forge: Use new dimensions information
BlockPos blockpos2 = worldserver.func_175694_M();
entityplayermp.field_71135_a.func_147364_a(entityplayermp.field_70165_t, entityplayermp.field_70163_u, entityplayermp.field_70161_v, entityplayermp.field_70177_z, entityplayermp.field_70125_A);
entityplayermp.field_71135_a.func_147359_a(new SPacketSpawnPosition(blockpos2));
@@ -447,6 +472,7 @@
this.field_177454_f.put(entityplayermp.func_110124_au(), entityplayermp);
entityplayermp.func_71116_b();
entityplayermp.func_70606_j(entityplayermp.func_110143_aJ());
@@ -115,7 +126,7 @@
return entityplayermp;
}
@@ -457,15 +482,19 @@
@@ -457,15 +483,19 @@
}
public void func_187242_a(EntityPlayerMP p_187242_1_, DimensionType p_187242_2_) {
@@ -139,7 +150,7 @@
this.func_72375_a(p_187242_1_, worldserver);
p_187242_1_.field_71135_a.func_147364_a(p_187242_1_.field_70165_t, p_187242_1_.field_70163_u, p_187242_1_.field_70161_v, p_187242_1_.field_70177_z, p_187242_1_.field_70125_A);
p_187242_1_.field_71134_c.func_73080_a(worldserver1);
@@ -477,29 +506,25 @@
@@ -477,29 +507,25 @@
p_187242_1_.field_71135_a.func_147359_a(new SPacketEntityEffect(p_187242_1_.func_145782_y(), potioneffect));
}
@@ -182,7 +193,7 @@
BlockPos blockpos;
if (p_82448_2_ == DimensionType.THE_END) {
blockpos = p_82448_4_.func_175694_M();
@@ -517,13 +542,14 @@
@@ -517,13 +543,14 @@
}
p_82448_3_.field_72984_F.func_76319_b();
@@ -0,0 +1,10 @@
--- a/net/minecraft/village/VillageSiege.java
+++ b/net/minecraft/village/VillageSiege.java
@@ -115,6 +115,7 @@
Vec3d vec3d = this.func_179867_a(new BlockPos(this.field_75532_g, this.field_75538_h, this.field_75539_i));
if (vec3d != null) {
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.village.VillageSiegeEvent(this, field_75537_a, entityplayer, field_75531_f, vec3d))) return false;
break;
}
}
@@ -1,11 +0,0 @@
--- a/net/minecraft/world/chunk/ChunkSection.java
+++ b/net/minecraft/world/chunk/ChunkSection.java
@@ -35,6 +35,8 @@
}
public void func_177484_a(int p_177484_1_, int p_177484_2_, int p_177484_3_, IBlockState p_177484_4_) {
+ if (p_177484_4_ instanceof net.minecraftforge.common.property.IExtendedBlockState)
+ p_177484_4_ = ((net.minecraftforge.common.property.IExtendedBlockState)p_177484_4_).getClean();
IBlockState iblockstate = this.func_177485_a(p_177484_1_, p_177484_2_, p_177484_3_);
IFluidState ifluidstate = this.func_206914_b(p_177484_1_, p_177484_2_, p_177484_3_);
IFluidState ifluidstate1 = p_177484_4_.func_204520_s();
@@ -0,0 +1,92 @@
--- a/net/minecraft/world/chunk/storage/RegionFile.java
+++ b/net/minecraft/world/chunk/storage/RegionFile.java
@@ -18,6 +18,10 @@
import net.minecraft.util.Util;
public class RegionFile {
+ // Minecraft is limited to 256 sections per chunk. So 1MB. This can easily be override.
+ // So we extend this to use the REAL size when the count is maxed by seeking to that section and reading the length.
+ private static final boolean FORGE_ENABLE_EXTENDED_SAVE = Boolean.parseBoolean(System.getProperty("forge.enableExtendedSave", "true"));
+ private static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger();
private static final byte[] field_76720_a = new byte[4096];
private final File field_76718_b;
private RandomAccessFile field_76719_c;
@@ -63,11 +67,21 @@
for(int j1 = 0; j1 < 1024; ++j1) {
int k = this.field_76719_c.readInt();
this.field_76716_d[j1] = k;
- if (k != 0 && (k >> 8) + (k & 255) <= this.field_76714_f.size()) {
- for(int l = 0; l < (k & 255); ++l) {
+ int length = k & 255;
+ if (length == 255) {
+ if ((k >> 8) <= this.field_76714_f.size()) { // We're maxed out, so we need to read the proper length from the section
+ this.field_76719_c.seek((k >> 8) * 4096);
+ length = (this.field_76719_c.readInt() + 4) / 4096 + 1;
+ this.field_76719_c.seek(j1 * 4 + 4); //Go back to where we were
+ }
+ }
+ if (k != 0 && (k >> 8) + length <= this.field_76714_f.size()) {
+ for (int l = 0; l < length; ++l) {
this.field_76714_f.set((k >> 8) + l, false);
}
}
+ else if (length > 0)
+ LOGGER.warn("Invalid chunk: ({}, {}) Offset: {} Length: {} runs off end file. {}", j1 % 32, (int)(j1 / 32), k >> 8, length, p_i2001_1_);
}
for(int k1 = 0; k1 < 1024; ++k1) {
@@ -92,14 +106,20 @@
} else {
int j = i >> 8;
int k = i & 255;
+ if (k == 255) {
+ this.field_76719_c.seek(j * 4096);
+ k = (this.field_76719_c.readInt() + 4) / 4096 + 1;
+ }
if (j + k > this.field_76714_f.size()) {
return null;
} else {
this.field_76719_c.seek((long)(j * 4096));
int l = this.field_76719_c.readInt();
if (l > 4096 * k) {
+ LOGGER.warn("Invalid chunk: ({}, {}) Offset: {} Invalid Size: {}>{} {}", p_76704_1_, p_76704_2_, j, l, k * 4096, field_76718_b);
return null;
} else if (l <= 0) {
+ LOGGER.warn("Invalid chunk: ({}, {}) Offset: {} Invalid Size: {} {}", p_76704_1_, p_76704_2_, j, l, field_76718_b);
return null;
} else {
byte b0 = this.field_76719_c.readByte();
@@ -162,9 +182,14 @@
int i = this.func_76707_e(p_76706_1_, p_76706_2_);
int j = i >> 8;
int k = i & 255;
+ if (k == 255) {
+ this.field_76719_c.seek(j * 4096);
+ k = (this.field_76719_c.readInt() + 4) / 4096 + 1;
+ }
int l = (p_76706_4_ + 5) / 4096 + 1;
if (l >= 256) {
- return;
+ if (!FORGE_ENABLE_EXTENDED_SAVE) return;
+ LOGGER.warn("Large Chunk Detected: ({}, {}) Size: {} {}", p_76706_1_, p_76706_2_, l, field_76718_b);
}
if (j != 0 && k == l) {
@@ -197,7 +222,7 @@
if (j1 >= l) {
j = l1;
- this.func_76711_a(p_76706_1_, p_76706_2_, l1 << 8 | l);
+ this.func_76711_a(p_76706_1_, p_76706_2_, l1 << 8 | (l > 255 ? 255 : l));
for(int j2 = 0; j2 < l; ++j2) {
this.field_76714_f.set(j + j2, false);
@@ -215,7 +240,7 @@
this.field_76715_g += 4096 * l;
this.func_76712_a(j, p_76706_3_, p_76706_4_);
- this.func_76711_a(p_76706_1_, p_76706_2_, j << 8 | l);
+ this.func_76711_a(p_76706_1_, p_76706_2_, j << 8 | (l > 255 ? 255 : l));
}
}
@@ -0,0 +1,18 @@
--- a/net/minecraft/world/gen/feature/structure/EndCityStructure.java
+++ b/net/minecraft/world/gen/feature/structure/EndCityStructure.java
@@ -110,5 +110,15 @@
public boolean func_75069_d() {
return this.field_186163_c;
}
+
+ //Forge: Fix losing of 'valid' flag on world reload. TODO: Remove in 1.14 as vanilla fixed.
+ public void func_143022_a(net.minecraft.nbt.NBTTagCompound tag) {
+ super.func_143022_a(tag);
+ tag.func_74757_a("Valid", this.field_186163_c);
+ }
+ public void func_143017_b(net.minecraft.nbt.NBTTagCompound tag) {
+ super.func_143017_b(tag);
+ this.field_186163_c = tag.func_74764_b("Valid") && tag.func_74767_n("Valid");
+ }
}
}
@@ -1,15 +1,15 @@
--- a/net/minecraft/world/gen/feature/structure/StructureStart.java
+++ b/net/minecraft/world/gen/feature/structure/StructureStart.java
@@ -70,6 +70,9 @@
}
@@ -72,6 +72,9 @@
public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) {
+ if (StructureIO.func_143033_a(this) == null) { // FORGE: This is just a more friendly error instead of the 'Null String' below
+ throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO");
+ }
NBTTagCompound nbttagcompound = new NBTTagCompound();
if (this.func_75069_d()) {
+ if (StructureIO.func_143033_a(this) == null) { // FORGE: This is just a more friendly error instead of the 'Null String' below
+ throw new RuntimeException("StructureStart \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO");
+ }
nbttagcompound.func_74778_a("id", StructureIO.func_143033_a(this));
nbttagcompound.func_74778_a("biome", IRegistry.field_212624_m.func_177774_c(this.field_202505_e).toString());
nbttagcompound.func_74768_a("ChunkX", p_143021_1_);
@@ -109,7 +112,8 @@
NBTTagList nbttaglist = p_143020_2_.func_150295_c("Children", 10);
@@ -64,22 +64,24 @@
}
}
@@ -1480,13 +1492,12 @@
@@ -1480,13 +1492,14 @@
EntityZombieVillager entityzombievillager = new EntityZombieVillager(p_74893_1_.func_201672_e());
entityzombievillager.func_70012_b((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F);
entityzombievillager.func_204210_a(p_74893_1_.func_175649_E(new BlockPos(entityzombievillager)), (IEntityLivingData)null, (NBTTagCompound)null);
- entityzombievillager.func_190733_a(this.func_180779_c(i, 0));
+ entityzombievillager.setProfession(this.chooseForgeProfession(i, net.minecraftforge.fml.common.registry.VillagerRegistry.FARMER.orElseThrow(() -> new IllegalStateException("Farmer profession not initialized?"))));
entityzombievillager.func_110163_bv();
p_74893_1_.func_72838_d(entityzombievillager);
} else {
EntityVillager entityvillager = new EntityVillager(p_74893_1_.func_201672_e());
entityvillager.func_70012_b((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F);
- entityvillager.func_70938_b(this.func_180779_c(i, p_74893_1_.func_201674_k().nextInt(6)));
+ net.minecraftforge.fml.common.registry.VillagerRegistry.setRandomProfession(entityvillager, p_74893_1_.func_201674_k());
+ entityvillager.setProfession(this.chooseForgeProfession(i, entityvillager.getProfessionForge()));
entityvillager.func_190672_a(p_74893_1_.func_175649_E(new BlockPos(entityvillager)), (IEntityLivingData)null, (NBTTagCompound)null, false);
p_74893_1_.func_72838_d(entityvillager);
}
@@ -1495,11 +1506,19 @@
@@ -1495,11 +1508,19 @@
}
}
@@ -0,0 +1,18 @@
--- a/net/minecraft/world/gen/feature/structure/WoodlandMansionStructure.java
+++ b/net/minecraft/world/gen/feature/structure/WoodlandMansionStructure.java
@@ -143,5 +143,15 @@
public boolean func_75069_d() {
return this.field_191093_c;
}
+
+ //Forge: Fix losing of 'valid' flag on world reload. TODO: Remove in 1.14 as vanilla fixed.
+ public void func_143022_a(net.minecraft.nbt.NBTTagCompound tag) {
+ super.func_143022_a(tag);
+ tag.func_74757_a("Valid", this.field_191093_c);
+ }
+ public void func_143017_b(net.minecraft.nbt.NBTTagCompound tag) {
+ super.func_143017_b(tag);
+ this.field_191093_c = tag.func_74764_b("Valid") && tag.func_74767_n("Valid");
+ }
}
}
@@ -9,3 +9,12 @@
Template.BlockInfo template$blockinfo1 = p_189960_3_ != null ? p_189960_3_.func_189943_a(p_189960_1_, blockpos, template$blockinfo) : template$blockinfo;
if (template$blockinfo1 != null) {
Block block1 = template$blockinfo1.field_186243_b.func_177230_c();
@@ -477,7 +479,7 @@
for(int l = 1; l < this.field_204769_a.size(); ++l) {
Template.BasicPalette template$basicpalette1 = list.get(l);
- template$basicpalette1.func_189956_a((this.field_204769_a.get(j).get(j)).field_186243_b, k);
+ template$basicpalette1.func_189956_a((this.field_204769_a.get(l).get(j)).field_186243_b, k); //Forge: j -> l, Fixes vanilla typo causing AIOOB writing template with multiple pellets.
}
}
@@ -1,180 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java
@@ -103,6 +103,21 @@
{
try
{
+ loadBlock(blockstatemapper, block, resourcelocation);
+ }
+ catch (Exception exception)
+ {
+ field_177603_c.warn((String)("Unable to load definition " + resourcelocation), (Throwable)exception);
+ }
+ }
+ }
+ }
+
+ protected void loadBlock(BlockStateMapper blockstatemapper, Block block, final ResourceLocation resourcelocation)
+ {
+ {
+ {
+ {
ModelBlockDefinition modelblockdefinition = this.func_177586_a(resourcelocation);
Map<IBlockState, ModelResourceLocation> map = blockstatemapper.func_188181_b(block);
@@ -115,7 +130,6 @@
if (collection1 == null)
{
collection1 = Lists.<ModelResourceLocation>newArrayList();
- this.field_188642_k.put(modelblockdefinition, collection1);
}
collection1.addAll(Lists.newArrayList(Iterables.filter(collection, new Predicate<ModelResourceLocation>()
@@ -125,6 +139,7 @@
return resourcelocation.equals(p_apply_1_);
}
})));
+ registerMultipartVariant(modelblockdefinition, collection1);
}
for (Entry<IBlockState, ModelResourceLocation> entry : map.entrySet())
@@ -135,22 +150,18 @@
{
try
{
- this.field_177612_i.put(modelresourcelocation, modelblockdefinition.func_188004_c(modelresourcelocation.func_177518_c()));
+ func_177569_a(modelblockdefinition, modelresourcelocation);
}
catch (RuntimeException var12)
{
if (!modelblockdefinition.func_188002_b())
{
- field_177603_c.warn("Unable to load variant: {} from {}", modelresourcelocation.func_177518_c(), modelresourcelocation);
+ field_177603_c.warn("Unable to load variant: " + modelresourcelocation.func_177518_c() + " from " + modelresourcelocation, var12);
}
}
}
}
}
- catch (Exception exception)
- {
- field_177603_c.warn("Unable to load definition {}", resourcelocation, exception);
- }
}
}
}
@@ -228,7 +239,7 @@
try
{
inputstream = p_188636_2_.func_110527_b();
- lvt_4_1_ = ModelBlockDefinition.func_178331_a(new InputStreamReader(inputstream, StandardCharsets.UTF_8));
+ lvt_4_1_ = ModelBlockDefinition.parseFromReader(new InputStreamReader(inputstream, StandardCharsets.UTF_8), p_188636_1_);
}
catch (Exception exception)
{
@@ -394,6 +405,7 @@
protected void func_177592_e()
{
+ this.field_177613_u.clear(); // FML clear this to prevent double ups.
this.field_177613_u.put(Item.func_150898_a(Blocks.field_150348_b), Lists.newArrayList("stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"));
this.field_177613_u.put(Item.func_150898_a(Blocks.field_150346_d), Lists.newArrayList("dirt", "coarse_dirt", "podzol"));
this.field_177613_u.put(Item.func_150898_a(Blocks.field_150344_f), Lists.newArrayList("oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"));
@@ -441,6 +453,10 @@
this.field_177613_u.put(Items.field_179570_aq, Lists.newArrayList("oak_door"));
this.field_177613_u.put(Items.field_151124_az, Lists.newArrayList("oak_boat"));
this.field_177613_u.put(Items.field_190929_cY, Lists.newArrayList("totem"));
+ for (Entry<net.minecraftforge.registries.IRegistryDelegate<Item>, Set<String>> e : customVariantNames.entrySet())
+ {
+ this.field_177613_u.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator()));
+ }
}
protected List<String> func_177596_a(Item p_177596_1_)
@@ -457,7 +473,7 @@
protected ResourceLocation func_177583_a(String p_177583_1_)
{
- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_);
+ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", ""));
return new ResourceLocation(resourcelocation.func_110624_b(), "item/" + resourcelocation.func_110623_a());
}
@@ -565,7 +581,7 @@
for (Entry<String, ResourceLocation> entry : this.field_177615_s.entrySet())
{
ResourceLocation resourcelocation = entry.getValue();
- ModelResourceLocation modelresourcelocation = new ModelResourceLocation(entry.getKey(), "inventory");
+ ModelResourceLocation modelresourcelocation = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey());
ModelBlock modelblock = this.field_177611_h.get(resourcelocation);
if (modelblock != null && modelblock.func_178303_d())
@@ -653,6 +669,11 @@
@Nullable
private IBakedModel func_177578_a(ModelBlock p_177578_1_, ModelRotation p_177578_2_, boolean p_177578_3_)
{
+ return bakeModel(p_177578_1_, (net.minecraftforge.common.model.ITransformation)p_177578_2_, p_177578_3_);
+ }
+
+ protected IBakedModel bakeModel(ModelBlock p_177578_1_, net.minecraftforge.common.model.ITransformation p_177578_2_, boolean p_177578_3_)
+ {
TextureAtlasSprite textureatlassprite = this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c("particle")));
SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(p_177578_1_, p_177578_1_.func_187967_g())).func_177646_a(textureatlassprite);
@@ -669,13 +690,13 @@
BlockPartFace blockpartface = blockpart.field_178240_c.get(enumfacing);
TextureAtlasSprite textureatlassprite1 = this.field_177599_g.get(new ResourceLocation(p_177578_1_.func_178308_c(blockpartface.field_178242_d)));
- if (blockpartface.field_178244_b == null)
+ if (blockpartface.field_178244_b == null || !net.minecraftforge.common.model.TRSRTransformation.isInteger(p_177578_2_.getMatrix()))
{
- simplebakedmodel$builder.func_177648_a(this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
+ simplebakedmodel$builder.func_177648_a(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
}
else
{
- simplebakedmodel$builder.func_177650_a(p_177578_2_.func_177523_a(blockpartface.field_178244_b), this.func_177589_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
+ simplebakedmodel$builder.func_177650_a(p_177578_2_.rotate(blockpartface.field_178244_b), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_177578_2_, p_177578_3_));
}
}
}
@@ -686,9 +707,14 @@
private BakedQuad func_177589_a(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_)
{
- return this.field_177607_l.func_178414_a(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e);
+ return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.common.model.ITransformation)p_177589_5_, p_177589_6_);
}
+ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.common.model.ITransformation p_177589_5_, boolean p_177589_6_)
+ {
+ return this.field_177607_l.makeBakedQuad(p_177589_1_.field_178241_a, p_177589_1_.field_178239_b, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.field_178237_d, p_177589_6_, p_177589_1_.field_178238_e);
+ }
+
private void func_177597_h()
{
this.func_177574_i();
@@ -916,4 +942,23 @@
field_177606_o.field_178317_b = "generation marker";
field_177616_r.field_178317_b = "block entity marker";
}
+
+ protected void registerMultipartVariant(ModelBlockDefinition definition, Collection<ModelResourceLocation> locations)
+ {
+ this.field_188642_k.put(definition, locations);
+ }
+
+ private static Map<net.minecraftforge.registries.IRegistryDelegate<Item>, Set<String>> customVariantNames = Maps.newHashMap();
+
+ public static void registerItemVariants(Item item, ResourceLocation... names)
+ {
+ if (!customVariantNames.containsKey(item.delegate))
+ {
+ customVariantNames.put(item.delegate, Sets.<String>newHashSet());
+ }
+ for(ResourceLocation name : names)
+ {
+ customVariantNames.get(item.delegate).add(name.toString());
+ }
+ }
}
@@ -1,91 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java
+++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java
@@ -49,9 +49,31 @@
this.field_193416_e = p_i46673_2_;
}
@Nullable
public Chunk func_75815_a(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException
{
+ Object[] data = this.loadChunk__Async(p_75815_1_, p_75815_2_, p_75815_3_);
+
+ if (data != null)
+ {
+ Chunk chunk = (Chunk) data[0];
+ NBTTagCompound nbttagcompound = (NBTTagCompound) data[1];
+ this.loadEntities(p_75815_1_, nbttagcompound.func_74775_l("Level"), chunk);
+ return chunk;
+ }
+
+ return null;
+ }
+
+ @Nullable
+ public Object[] loadChunk__Async(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException
+ {
ChunkPos chunkpos = new ChunkPos(p_75815_2_, p_75815_3_);
NBTTagCompound nbttagcompound = this.field_75828_a.get(chunkpos);
@@ -67,7 +89,7 @@
nbttagcompound = this.field_193416_e.func_188257_a(FixTypes.CHUNK, CompressedStreamTools.func_74794_a(datainputstream));
}
- return this.func_75822_a(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound);
+ return this.checkedReadChunkFromNBT__Async(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound);
}
public boolean func_191063_a(int p_191063_1_, int p_191063_2_)
@@ -80,6 +102,13 @@
@Nullable
protected Chunk func_75822_a(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_)
{
+ Object[] data = this.checkedReadChunkFromNBT__Async(p_75822_1_, p_75822_2_, p_75822_3_, p_75822_4_);
+ return data != null ? (Chunk)data[0] : null;
+ }
+
+ @Nullable
+ protected Object[] checkedReadChunkFromNBT__Async(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_)
+ {
if (!p_75822_4_.func_150297_b("Level", 10))
{
field_151505_a.error("Chunk file at {},{} is missing level data, skipping", Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_));
@@ -103,10 +132,29 @@
field_151505_a.error("Chunk file at {},{} is in the wrong location; relocating. (Expected {}, {}, got {}, {})", Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(p_75822_2_), Integer.valueOf(p_75822_3_), Integer.valueOf(chunk.field_76635_g), Integer.valueOf(chunk.field_76647_h));
nbttagcompound.func_74768_a("xPos", p_75822_2_);
nbttagcompound.func_74768_a("zPos", p_75822_3_);
+
+ // Have to move tile entities since we don't load them at this stage
+ NBTTagList _tileEntities = nbttagcompound.func_150295_c("TileEntities", 10);
+
+ if (_tileEntities != null)
+ {
+ for (int te = 0; te < _tileEntities.func_74745_c(); te++)
+ {
+ NBTTagCompound _nbt = (NBTTagCompound) _tileEntities.func_150305_b(te);
+ _nbt.func_74768_a("x", p_75822_2_ * 16 + (_nbt.func_74762_e("x") - chunk.field_76635_g * 16));
+ _nbt.func_74768_a("z", p_75822_3_ * 16 + (_nbt.func_74762_e("z") - chunk.field_76647_h * 16));
+ }
+ }
+
chunk = this.func_75823_a(p_75822_1_, nbttagcompound);
}
- return chunk;
+ Object[] data = new Object[2];
+ data[0] = chunk;
+ data[1] = p_75822_4_;
+ // event is fired in ChunkIOProvider.callStage2 since it must be fired after TE's load.
+ // MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, par4NBTTagCompound));
+ return data;
}
}
}
@@ -121,7 +169,10 @@
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound.func_74782_a("Level", nbttagcompound1);
nbttagcompound.func_74768_a("DataVersion", 1343);
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(nbttagcompound);
this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1);
this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound);
}
catch (Exception exception)
@@ -1,60 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDynamicLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDynamicLiquid.java
@@ -26,6 +26,7 @@
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
+ if (!p_180650_1_.func_175697_a(p_180650_2_, this.func_185698_b(p_180650_1_))) return; // Forge: avoid loading unloaded chunks
int i = ((Integer)p_180650_3_.func_177229_b(field_176367_b)).intValue();
int j = 1;
@@ -67,7 +68,7 @@
}
}
- if (this.field_149815_a >= 2 && this.field_149764_J == Material.field_151586_h)
+ if (this.field_149815_a >= 2 && net.minecraftforge.event.ForgeEventFactory.canCreateFluidSource(p_180650_1_, p_180650_2_, p_180650_3_, this.field_149764_J == Material.field_151586_h))
{
IBlockState iblockstate = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
@@ -118,7 +119,7 @@
{
if (this.field_149764_J == Material.field_151587_i && p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185904_a() == Material.field_151586_h)
{
- p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), Blocks.field_150348_b.func_176223_P());
+ p_180650_1_.func_175656_a(p_180650_2_.func_177977_b(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, p_180650_2_.func_177977_b(), p_180650_2_, Blocks.field_150348_b.func_176223_P()));
this.func_180688_d(p_180650_1_, p_180650_2_.func_177977_b());
return;
}
@@ -166,6 +167,7 @@
}
else
{
+ if (p_176375_3_.func_177230_c() != Blocks.field_150431_aC) //Forge: Vanilla has a 'bug' where snowballs don't drop like every other block. So special case because ewww...
p_176375_3_.func_177230_c().func_176226_b(p_176375_1_, p_176375_2_, p_176375_3_, 0);
}
}
@@ -187,7 +189,7 @@
if (!this.func_176372_g(p_176374_1_, blockpos, iblockstate) && (iblockstate.func_185904_a() != this.field_149764_J || ((Integer)iblockstate.func_177229_b(field_176367_b)).intValue() > 0))
{
- if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), iblockstate))
+ if (!this.func_176372_g(p_176374_1_, blockpos.func_177977_b(), p_176374_1_.func_180495_p(blockpos.func_177977_b())))
{
return p_176374_3_;
}
@@ -254,11 +256,12 @@
private boolean func_176372_g(World p_176372_1_, BlockPos p_176372_2_, IBlockState p_176372_3_)
{
- Block block = p_176372_1_.func_180495_p(p_176372_2_).func_177230_c();
+ Block block = p_176372_3_.func_177230_c(); //Forge: state must be valid for position
+ Material mat = p_176372_3_.func_185904_a();
if (!(block instanceof BlockDoor) && block != Blocks.field_150472_an && block != Blocks.field_150468_ap && block != Blocks.field_150436_aH)
{
- return block.field_149764_J != Material.field_151567_E && block.field_149764_J != Material.field_189963_J ? block.field_149764_J.func_76230_c() : true;
+ return mat != Material.field_151567_E && mat != Material.field_189963_J ? mat.func_76230_c() : true;
}
else
{
@@ -1,64 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
@@ -152,12 +152,14 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ IBlockState downState = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && (downState.func_185896_q() || downState.func_193401_d(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) == BlockFaceShape.SOLID);
}
public void func_189540_a(IBlockState p_189540_1_, World p_189540_2_, BlockPos p_189540_3_, Block p_189540_4_, BlockPos p_189540_5_)
{
- if (!p_189540_2_.func_180495_p(p_189540_3_.func_177977_b()).func_185896_q())
+ IBlockState downState = p_189540_2_.func_180495_p(p_189540_3_.func_177977_b());
+ if (!downState.func_185896_q() && downState.func_193401_d(p_189540_2_, p_189540_3_.func_177977_b(), EnumFacing.UP) != BlockFaceShape.SOLID)
{
this.func_176226_b(p_189540_2_, p_189540_3_, p_189540_1_, 0);
p_189540_2_.func_175698_g(p_189540_3_);
@@ -166,13 +168,6 @@
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
-
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
- {
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- }
-
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
@@ -398,6 +393,30 @@
return BlockFaceShape.UNDEFINED;
}
+
+ /*============================FORGE START=====================================*/
+ @Override
+ public void getDrops(net.minecraft.util.NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ super.getDrops(drops, world, pos, state, fortune);
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
+ if (te != null && te.func_145965_a() != null)
+ drops.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
+ }
+ @Override
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
+ }
+ @Override
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack tool)
+ {
+ super.func_180657_a(world, player, pos, state, te, tool);
+ world.func_175698_g(pos);
+ }
+ /*===========================FORGE END==========================================*/
+
public static enum EnumFlowerType implements IStringSerializable
{
EMPTY("empty"),
@@ -1,51 +0,0 @@
@@ -53,9 +53,9 @@
BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1);
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -83,7 +83,8 @@
this.field_150128_a = new int[32768];
}
- if (p_180650_1_.func_175707_a(new BlockPos(k - 5, l - 5, i1 - 5), new BlockPos(k + 5, l + 5, i1 + 5)))
+ if (!p_180650_1_.func_175697_a(p_180650_2_, 1)) return; // Forge: prevent decaying leaves from updating neighbors and loading unloaded chunks
+ if (p_180650_1_.func_175697_a(p_180650_2_, 6)) // Forge: extend range from 5 to 6 to account for neighbor checks in world.markAndNotifyBlock -> world.updateObservingBlocksAt
{
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
@@ -96,9 +97,9 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2));
Block block = iblockstate.func_177230_c();
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
+ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
- if (iblockstate.func_185904_a() == Material.field_151584_j)
+ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
this.field_150128_a[(i2 + 16) * 1024 + (j2 + 16) * 32 + k2 + 16] = -2;
}
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_)
@@ -274,6 +242,51 @@
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
+ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
+ {
+ if (!(Boolean)state.func_177229_b(field_176236_b))
+ {
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
+ }
+ }
+
@@ -1,49 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
@@ -284,14 +284,14 @@
if (integer.intValue() == 0)
{
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150343_Z.func_176223_P());
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150343_Z.func_176223_P()));
this.func_180688_d(p_176365_1_, p_176365_2_);
return true;
}
if (integer.intValue() <= 4)
{
- p_176365_1_.func_175656_a(p_176365_2_, Blocks.field_150347_e.func_176223_P());
+ p_176365_1_.func_175656_a(p_176365_2_, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_176365_1_, p_176365_2_, p_176365_2_, Blocks.field_150347_e.func_176223_P()));
this.func_180688_d(p_176365_1_, p_176365_2_);
return true;
}
@@ -452,4 +452,29 @@
{
return BlockFaceShape.UNDEFINED;
}
+
+ @Override
+ @SideOnly (Side.CLIENT)
+ public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks)
+ {
+ Vec3d viewport = net.minecraft.client.renderer.ActiveRenderInfo.func_178806_a(entity, partialTicks);
+
+ if (state.func_185904_a().func_76224_d())
+ {
+ float height = 0.0F;
+ if (state.func_177230_c() instanceof BlockLiquid)
+ {
+ height = func_149801_b(state.func_177229_b(field_176367_b)) - 0.11111111F;
+ }
+ float f1 = (float) (pos.func_177956_o() + 1) - height;
+ if (viewport.field_72448_b > (double)f1)
+ {
+ BlockPos upPos = pos.func_177984_a();
+ IBlockState upState = world.func_180495_p(upPos);
+ return upState.func_177230_c().getFogColor(world, upPos, upState, entity, originalColor, partialTicks);
+ }
+ }
+
+ return super.getFogColor(world, pos, state, entity, originalColor, partialTicks);
+ }
}
-24
View File
@@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -34,9 +34,9 @@
{
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -69,6 +69,9 @@
}
}
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
public static enum EnumAxis implements IStringSerializable
{
X("x"),
@@ -1,15 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockObserver.java
+++ ../src-work/minecraft/net/minecraft/block/BlockObserver.java
@@ -145,4 +145,12 @@
{
return this.func_176223_P().func_177226_a(field_176387_N, EnumFacing.func_82600_a(p_176203_1_ & 7));
}
+
+ /* ======================================== FORGE START =====================================*/
+ @Override
+ public void observedNeighborChange(IBlockState observerState, World world, BlockPos observerPos, Block changedBlock, BlockPos changedBlockPos)
+ {
+ func_190962_b(observerState, world, observerPos, changedBlock, changedBlockPos);
+ }
+ /* ========================================= FORGE END ======================================*/
}
-39
View File
@@ -1,39 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSlab.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java
@@ -80,6 +80,19 @@
return this.func_176552_j();
}
+ @Override
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
+ return super.doesSideBlockRendering(state, world, pos, face);
+
+ if ( state.func_185914_p() )
+ return true;
+
+ EnumBlockHalf side = state.func_177229_b(field_176554_a);
+ return (side == EnumBlockHalf.TOP && face == EnumFacing.UP) || (side == EnumBlockHalf.BOTTOM && face == EnumFacing.DOWN);
+ }
+
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)
{
IBlockState iblockstate = super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM);
@@ -115,7 +128,7 @@
{
return false;
}
- else
+ else if (false) // Forge: Additional logic breaks doesSideBlockRendering and is no longer useful.
{
IBlockState iblockstate = p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_));
boolean flag = func_185675_i(iblockstate) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP;
@@ -149,6 +162,7 @@
return !func_185675_i(iblockstate) || flag;
}
}
+ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_);
}
@SideOnly(Side.CLIENT)
@@ -1,32 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java
@@ -483,6 +483,29 @@
return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M});
}
+ @Override
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ if (net.minecraftforge.common.ForgeModContainer.disableStairSlabCulling)
+ return super.doesSideBlockRendering(state, world, pos, face);
+
+ if ( state.func_185914_p() )
+ return true;
+
+ state = this.func_176221_a(state, world, pos);
+
+ EnumHalf half = state.func_177229_b(field_176308_b);
+ EnumFacing side = state.func_177229_b(field_176309_a);
+ EnumShape shape = state.func_177229_b(field_176310_M);
+ if (face == EnumFacing.UP) return half == EnumHalf.TOP;
+ if (face == EnumFacing.DOWN) return half == EnumHalf.BOTTOM;
+ if (shape == EnumShape.OUTER_LEFT || shape == EnumShape.OUTER_RIGHT) return false;
+ if (face == side) return true;
+ if (shape == EnumShape.INNER_LEFT && face.func_176746_e() == side) return true;
+ if (shape == EnumShape.INNER_RIGHT && face.func_176735_f() == side) return true;
+ return false;
+ }
+
public static enum EnumHalf implements IStringSerializable
{
TOP("top"),
@@ -1,39 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStaticLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStaticLiquid.java
@@ -52,22 +52,22 @@
{
blockpos = blockpos.func_177982_a(p_180650_4_.nextInt(3) - 1, 1, p_180650_4_.nextInt(3) - 1);
- if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256 && !p_180650_1_.func_175667_e(blockpos))
+ if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < p_180650_1_.func_72800_K() && !p_180650_1_.func_175667_e(blockpos))
{
return;
}
- Block block = p_180650_1_.func_180495_p(blockpos).func_177230_c();
+ IBlockState block = p_180650_1_.func_180495_p(blockpos);
- if (block.field_149764_J == Material.field_151579_a)
+ if (block.func_177230_c().isAir(block, p_180650_1_, blockpos))
{
if (this.func_176369_e(p_180650_1_, blockpos))
{
- p_180650_1_.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P());
+ p_180650_1_.func_175656_a(blockpos, net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, blockpos, p_180650_2_, Blocks.field_150480_ab.func_176223_P()));
return;
}
}
- else if (block.field_149764_J.func_76230_c())
+ else if (block.func_185904_a().func_76230_c())
{
return;
}
@@ -86,7 +86,7 @@
if (p_180650_1_.func_175623_d(blockpos1.func_177984_a()) && this.func_176368_m(p_180650_1_, blockpos1))
{
- p_180650_1_.func_175656_a(blockpos1.func_177984_a(), Blocks.field_150480_ab.func_176223_P());
+ p_180650_1_.func_175656_a(blockpos1.func_177984_a(), net.minecraftforge.event.ForgeEventFactory.fireFluidPlaceBlockEvent(p_180650_1_, blockpos1.func_177984_a(), p_180650_2_, Blocks.field_150480_ab.func_176223_P()));
}
}
}
@@ -1,62 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java
+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java
@@ -35,6 +35,7 @@
public final IChunkLoader field_73247_e;
public final Long2ObjectMap<Chunk> field_73244_f = new Long2ObjectOpenHashMap<Chunk>(8192);
public final WorldServer field_73251_h;
+ private final Set<Long> loadingChunks = com.google.common.collect.Sets.newHashSet();
public ChunkProviderServer(WorldServer p_i46838_1_, IChunkLoader p_i46838_2_, IChunkGenerator p_i46838_3_)
{
@@ -85,20 +86,47 @@
@Nullable
public Chunk func_186028_c(int p_186028_1_, int p_186028_2_)
{
- Chunk chunk = this.func_186026_b(p_186028_1_, p_186028_2_);
+ return loadChunk(p_186028_1_, p_186028_2_, null);
+ }
+ @Nullable
+ public Chunk loadChunk(int p_186028_1_, int p_186028_2_, @Nullable Runnable runnable)
+ {
+ Chunk chunk = this.func_186026_b(p_186028_1_, p_186028_2_);
if (chunk == null)
{
- chunk = this.func_73239_e(p_186028_1_, p_186028_2_);
-
- if (chunk != null)
+ long pos = ChunkPos.func_77272_a(p_186028_1_, p_186028_2_);
+ chunk = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(pos, this.field_73251_h);
+ if (chunk != null || !(this.field_73247_e instanceof net.minecraft.world.chunk.storage.AnvilChunkLoader))
{
+ if (!loadingChunks.add(pos)) net.minecraftforge.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk ({},{}) in dimension {} that is already being loaded. This will cause weird chunk breakages.", p_186028_1_, p_186028_2_, this.field_73251_h.field_73011_w.getDimension());
+ if (chunk == null) chunk = this.func_73239_e(p_186028_1_, p_186028_2_);
+
+ if (chunk != null)
+ {
this.field_73244_f.put(ChunkPos.func_77272_a(p_186028_1_, p_186028_2_), chunk);
chunk.func_76631_c();
chunk.func_186030_a(this, this.field_186029_c);
+ }
+
+ loadingChunks.remove(pos);
}
+ else
+ {
+ net.minecraft.world.chunk.storage.AnvilChunkLoader loader = (net.minecraft.world.chunk.storage.AnvilChunkLoader) this.field_73247_e;
+ if (runnable == null || !net.minecraftforge.common.ForgeChunkManager.asyncChunkLoading)
+ chunk = net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, p_186028_1_, p_186028_2_);
+ else if (loader.func_191063_a(p_186028_1_, p_186028_2_))
+ {
+ // We can only use the async queue for already generated chunks
+ net.minecraftforge.common.chunkio.ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, p_186028_1_, p_186028_2_, runnable);
+ return null;
+ }
+ }
}
+ // If we didn't load the chunk async and have a callback run it now
+ if (runnable != null) runnable.run();
return chunk;
}
@@ -1,10 +0,0 @@
--- ../src-base/minecraft/net/minecraft/util/datafix/DataFixesManager.java
+++ ../src-work/minecraft/net/minecraft/util/datafix/DataFixesManager.java
@@ -165,6 +165,7 @@
public static DataFixer func_188279_a()
{
DataFixer datafixer = new DataFixer(1343);
+ datafixer = new net.minecraftforge.common.util.CompoundDataFixer(datafixer);
WorldInfo.func_189967_a(datafixer);
EntityPlayerMP.func_191522_a(datafixer);
EntityPlayer.func_189806_a(datafixer);
@@ -1,43 +0,0 @@
--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentThorns.java
+++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentThorns.java
@@ -51,12 +51,12 @@
if (!itemstack.func_190926_b())
{
- itemstack.func_77972_a(3, p_151367_1_);
+ damageArmor(itemstack, 3, p_151367_1_);
}
}
else if (!itemstack.func_190926_b())
{
- itemstack.func_77972_a(1, p_151367_1_);
+ damageArmor(itemstack, 1, p_151367_1_);
}
}
@@ -76,4 +76,25 @@
{
return p_92095_0_ > 10 ? p_92095_0_ - 10 : 1 + p_92095_1_.nextInt(4);
}
+
+ private void damageArmor(ItemStack stack, int amount, EntityLivingBase entity)
+ {
+ int slot = -1;
+ int x = 0;
+ for (ItemStack i : entity.func_184193_aE())
+ {
+ if (i == stack){
+ slot = x;
+ break;
+ }
+ x++;
+ }
+ if (slot == -1 || !(stack.func_77973_b() instanceof net.minecraftforge.common.ISpecialArmor))
+ {
+ stack.func_77972_a(1, entity);
+ return;
+ }
+ net.minecraftforge.common.ISpecialArmor armor = (net.minecraftforge.common.ISpecialArmor)stack.func_77973_b();
+ armor.damageArmor(entity, stack, DamageSource.func_92087_a(entity), amount, slot);
+ }
}
-183
View File
@@ -1,183 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/EntityList.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityList.java
@@ -107,10 +107,8 @@
public static final ResourceLocation field_191307_a = new ResourceLocation("lightning_bolt");
private static final ResourceLocation field_191310_e = new ResourceLocation("player");
private static final Logger field_151516_b = LogManager.getLogger();
- public static final RegistryNamespaced < ResourceLocation, Class <? extends Entity >> field_191308_b = new RegistryNamespaced < ResourceLocation, Class <? extends Entity >> ();
public static final Map<ResourceLocation, EntityList.EntityEggInfo> field_75627_a = Maps.<ResourceLocation, EntityList.EntityEggInfo>newLinkedHashMap();
- public static final Set<ResourceLocation> field_191309_d = Sets.<ResourceLocation>newHashSet();
- private static final List<String> field_191311_g = Lists.<String>newArrayList();
+ private static final Set<ResourceLocation> EXTRA_NAMES = Sets.newHashSet();
@Nullable
public static ResourceLocation func_191301_a(Entity p_191301_0_)
@@ -121,38 +119,54 @@
@Nullable
public static ResourceLocation func_191306_a(Class <? extends Entity > p_191306_0_)
{
- return field_191308_b.func_177774_c(p_191306_0_);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_191306_0_);
+ return entry == null ? null : entry.getRegistryName();
}
@Nullable
public static String func_75621_b(Entity p_75621_0_)
{
- int i = field_191308_b.func_148757_b(p_75621_0_.getClass());
- return i == -1 ? null : (String)field_191311_g.get(i);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_75621_0_.getClass());
+ return entry == null ? null : entry.getName();
}
@Nullable
public static String func_191302_a(@Nullable ResourceLocation p_191302_0_)
{
- int i = field_191308_b.func_148757_b(field_191308_b.func_82594_a(p_191302_0_));
- return i == -1 ? null : (String)field_191311_g.get(i);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(p_191302_0_);
+ return entry == null ? null : entry.getName();
}
@Nullable
@SideOnly(Side.CLIENT)
public static Class <? extends Entity > func_90035_a(int p_90035_0_)
{
- return (Class)field_191308_b.func_148754_a(p_90035_0_);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.registries.GameData.getEntityRegistry().getValue(p_90035_0_);
+ return entry == null ? null : entry.getEntityClass();
}
@Nullable
@SideOnly(Side.CLIENT)
public static Class <? extends Entity > func_192839_a(String p_192839_0_)
{
- return (Class)field_191308_b.func_82594_a(new ResourceLocation(p_192839_0_));
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(new ResourceLocation(p_192839_0_));
+ return entry == null ? null : entry.getEntityClass();
}
+ public static int getID(Class<? extends Entity> cls)
+ {
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(cls);
+ return entry == null ? -1 : net.minecraftforge.registries.GameData.getEntityRegistry().getID(entry);
+ }
+
@Nullable
+ public static Class<? extends Entity> getClass(ResourceLocation key)
+ {
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(key);
+ return entry == null ? null : entry.getEntityClass();
+ }
+
+ @Nullable
public static Entity func_191304_a(@Nullable Class <? extends Entity > p_191304_0_, World p_191304_1_)
{
if (p_191304_0_ == null)
@@ -163,6 +177,8 @@
{
try
{
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.EntityRegistry.getEntry(p_191304_0_);
+ if (entry != null) return entry.newInstance(p_191304_1_);
return p_191304_0_.getConstructor(World.class).newInstance(p_191304_1_);
}
catch (Exception exception)
@@ -177,13 +193,15 @@
@SideOnly(Side.CLIENT)
public static Entity func_75616_a(int p_75616_0_, World p_75616_1_)
{
- return func_191304_a(func_90035_a(p_75616_0_), p_75616_1_);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.registries.GameData.getEntityRegistry().getValue(p_75616_0_);
+ return entry == null ? null : entry.newInstance(p_75616_1_);
}
@Nullable
public static Entity func_188429_b(ResourceLocation p_188429_0_, World p_188429_1_)
{
- return func_191304_a(field_191308_b.func_82594_a(p_188429_0_), p_188429_1_);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(p_188429_0_);
+ return entry == null ? null : entry.newInstance(p_188429_1_);
}
@Nullable
@@ -198,7 +216,16 @@
}
else
{
+ try
+ {
entity.func_70020_e(p_75615_0_);
+ }
+ catch (Exception e)
+ {
+ net.minecraftforge.fml.common.FMLLog.log.error("An Entity {}({}) has thrown an exception during loading, its state cannot be restored. Report this to the mod author",
+ p_75615_0_.func_74779_i("id"), entity.func_70005_c_(), e);
+ entity = null;
+ }
}
return entity;
@@ -206,7 +233,7 @@
public static Set<ResourceLocation> func_180124_b()
{
- return field_191309_d;
+ return Sets.union(net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getKeys(), EXTRA_NAMES);
}
public static boolean func_180123_a(Entity p_180123_0_, ResourceLocation p_180123_1_)
@@ -373,7 +400,7 @@
func_191305_a("zombie_horse", 3232308, 9945732);
func_191305_a("zombie_pigman", 15373203, 5009705);
func_191305_a("zombie_villager", 5651507, 7969893);
- field_191309_d.add(field_191307_a);
+ EXTRA_NAMES.add(field_191307_a);
}
private static void func_191303_a(int p_191303_0_, String p_191303_1_, Class <? extends Entity > p_191303_2_, String p_191303_3_)
@@ -394,22 +421,17 @@
else
{
ResourceLocation resourcelocation = new ResourceLocation(p_191303_1_);
- field_191308_b.func_177775_a(p_191303_0_, resourcelocation, p_191303_2_);
- field_191309_d.add(resourcelocation);
-
- while (field_191311_g.size() <= p_191303_0_)
- {
- field_191311_g.add(null);
- }
-
- field_191311_g.set(p_191303_0_, p_191303_3_);
+ net.minecraftforge.registries.GameData.registerEntity(p_191303_0_, resourcelocation, p_191303_2_, p_191303_3_);
}
}
protected static EntityList.EntityEggInfo func_191305_a(String p_191305_0_, int p_191305_1_, int p_191305_2_)
{
ResourceLocation resourcelocation = new ResourceLocation(p_191305_0_);
- return field_75627_a.put(resourcelocation, new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_));
+ EntityList.EntityEggInfo egg = new EntityList.EntityEggInfo(resourcelocation, p_191305_1_, p_191305_2_);
+ net.minecraftforge.fml.common.registry.EntityEntry entry = net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES.getValue(resourcelocation);
+ if (entry != null) entry.setEgg(egg);
+ return (EntityList.EntityEggInfo)field_75627_a.put(resourcelocation, egg);
}
public static class EntityEggInfo
@@ -428,5 +450,16 @@
this.field_151512_d = StatList.func_151182_a(this);
this.field_151513_e = StatList.func_151176_b(this);
}
+
+ // Forge start
+ public EntityEggInfo(ResourceLocation id, int primaryColor, int secondaryColor, StatBase killEntityStatistic, StatBase entityKilledByStatistic)
+ {
+ this.field_75613_a = id;
+ this.field_75611_b = primaryColor;
+ this.field_75612_c = secondaryColor;
+ this.field_151512_d = killEntityStatistic;
+ this.field_151513_e = entityKilledByStatistic;
+ }
+ // Forge end
}
}
@@ -1,19 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java
+++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java
@@ -105,18 +119,20 @@
@Nullable
public AxisAlignedBB func_70046_E()
{
+ if (getCollisionHandler() != null) return getCollisionHandler().getBoundingBox(this);
return null;
}
@@ -1014,7 +1046,237 @@
{
this.func_184212_Q().func_187227_b(field_184270_f, Boolean.valueOf(p_94096_1_));
}
+
+ @Override
+ public boolean func_184230_a(EntityPlayer player, net.minecraft.util.EnumHand hand)
+ {
+ return net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player, hand));
+ }
@@ -1,15 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
+++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
@@ -158,9 +158,9 @@
super(p_i45285_2_, p_i45285_3_);
p_i45285_4_.field_73090_b = this;
this.field_71134_c = p_i45285_4_;
- BlockPos blockpos = p_i45285_2_.func_175694_M();
+ BlockPos blockpos = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint();
- if (p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE)
+ if (false && p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE)
{
int i = Math.max(0, p_i45285_1_.func_184108_a(p_i45285_2_));
int j = MathHelper.func_76128_c(p_i45285_2_.func_175723_af().func_177729_b((double)blockpos.func_177958_n(), (double)blockpos.func_177952_p()));
@@ -1,68 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -448,6 +449,15 @@
}
}
+ private boolean isHeadspaceFree(BlockPos pos, int height)
+ {
+ for (int y = 0; y < height; y++)
+ {
+ if (!func_175162_d(pos.func_177982_a(0, y, 0))) return false;
+ }
+ return true;
+ }
+
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
{
if (this.field_70145_X)
@@ -460,30 +470,34 @@
double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
double d1 = p_145771_5_ - (double)blockpos.func_177952_p();
- if (!this.func_175162_d(blockpos))
+ int entHeight = Math.max((int)Math.ceil(this.field_70131_O), 1);
+
+ boolean inTranslucentBlock = !this.isHeadspaceFree(blockpos, entHeight);
+
+ if (inTranslucentBlock)
{
int i = -1;
double d2 = 9999.0D;
- if (this.func_175162_d(blockpos.func_177976_e()) && d0 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d0 < d2)
{
d2 = d0;
i = 0;
}
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d0 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d0 < d2)
{
d2 = 1.0D - d0;
i = 1;
}
- if (this.func_175162_d(blockpos.func_177978_c()) && d1 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d1 < d2)
{
d2 = d1;
i = 4;
}
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d1 < d2)
+ if (this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d1 < d2)
{
d2 = 1.0D - d1;
i = 5;
@@ -518,7 +532,8 @@
private boolean func_175162_d(BlockPos p_175162_1_)
{
- return !this.field_70170_p.func_180495_p(p_175162_1_).func_185915_l() && !this.field_70170_p.func_180495_p(p_175162_1_.func_177984_a()).func_185915_l();
+ IBlockState iblockstate = field_70170_p.func_180495_p(p_175162_1_);
+ return !iblockstate.func_177230_c().isNormalCube(iblockstate, field_70170_p, p_175162_1_);
}
public void func_70031_b(boolean p_70031_1_)
@@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java
@@ -77,6 +77,8 @@
public void func_72786_a(Entity p_72786_1_)
{
+ if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) return;
+
if (p_72786_1_ instanceof EntityPlayerMP)
{
this.func_72791_a(p_72786_1_, 512, 2);
-152
View File
@@ -1,152 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/FontRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/gui/FontRenderer.java
@@ -57,7 +57,7 @@
this.field_111273_g = p_i1035_2_;
this.field_78298_i = p_i1035_3_;
this.field_78293_l = p_i1035_4_;
- p_i1035_3_.func_110577_a(this.field_111273_g);
+ bindTexture(this.field_111273_g);
for (int i = 0; i < 32; ++i)
{
@@ -107,7 +107,7 @@
try
{
- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g);
+ iresource = getResource(this.field_111273_g);
bufferedimage = TextureUtil.func_177053_a(iresource.func_110527_b());
}
catch (IOException ioexception)
@@ -172,7 +172,7 @@
try
{
- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin"));
+ iresource = getResource(new ResourceLocation("font/glyph_sizes.bin"));
iresource.func_110527_b().read(this.field_78287_e);
}
catch (IOException ioexception)
@@ -187,6 +187,7 @@
private float func_181559_a(char p_181559_1_, boolean p_181559_2_)
{
+ if (p_181559_1_ == 160) return 4.0F; // forge: display nbsp as space. MC-2595
if (p_181559_1_ == ' ')
{
return 4.0F;
@@ -203,7 +204,7 @@
int i = p_78266_1_ % 16 * 8;
int j = p_78266_1_ / 16 * 8;
int k = p_78266_2_ ? 1 : 0;
- this.field_78298_i.func_110577_a(this.field_111273_g);
+ bindTexture(this.field_111273_g);
int l = this.field_78286_d[p_78266_1_];
float f = (float)l - 0.01F;
GlStateManager.func_187447_r(5);
@@ -231,7 +232,7 @@
private void func_78257_a(int p_78257_1_)
{
- this.field_78298_i.func_110577_a(this.func_111271_a(p_78257_1_));
+ bindTexture(this.func_111271_a(p_78257_1_));
}
protected float func_78277_a(char p_78277_1_, boolean p_78277_2_)
@@ -280,7 +281,7 @@
public int func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_)
{
- GlStateManager.func_179141_d();
+ enableAlpha();
this.func_78265_b();
int i;
@@ -350,7 +351,7 @@
int j1 = this.field_78285_g[i1];
this.field_78304_r = j1;
- GlStateManager.func_179131_c((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q);
+ setColor((float)(j1 >> 16) / 255.0F, (float)(j1 >> 8 & 255) / 255.0F, (float)(j1 & 255) / 255.0F, this.field_78305_q);
}
else if (i1 == 16)
{
@@ -379,7 +380,7 @@
this.field_78299_w = false;
this.field_78300_v = false;
this.field_78301_u = false;
- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
+ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
}
++i;
@@ -407,7 +408,7 @@
c0 = c1;
}
- float f1 = this.field_78293_l ? 0.5F : 1.0F;
+ float f1 = j == -1 || this.field_78293_l ? 0.5f : 1f;
boolean flag = (c0 == 0 || j == -1 || this.field_78293_l) && p_78255_2_;
if (flag)
@@ -445,7 +446,16 @@
++f;
}
+ doDraw(f);
+ }
+ }
+ }
+ protected void doDraw(float f)
+ {
+ {
+ {
+
if (this.field_78299_w)
{
Tessellator tessellator = Tessellator.func_178181_a();
@@ -518,7 +528,7 @@
this.field_78292_o = (float)(p_180455_4_ >> 8 & 255) / 255.0F;
this.field_78306_p = (float)(p_180455_4_ & 255) / 255.0F;
this.field_78305_q = (float)(p_180455_4_ >> 24 & 255) / 255.0F;
- GlStateManager.func_179131_c(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
+ setColor(this.field_78291_n, this.field_78292_o, this.field_78306_p, this.field_78305_q);
this.field_78295_j = p_180455_2_;
this.field_78296_k = p_180455_3_;
this.func_78255_a(p_180455_1_, p_180455_5_);
@@ -576,6 +586,7 @@
public int func_78263_a(char p_78263_1_)
{
+ if (p_78263_1_ == 160) return 4; // forge: display nbsp as space. MC-2595
if (p_78263_1_ == 167)
{
return -1;
@@ -849,6 +860,26 @@
return this.field_78294_m;
}
+ protected void setColor(float r, float g, float b, float a)
+ {
+ GlStateManager.func_179131_c(r,g,b,a);
+ }
+
+ protected void enableAlpha()
+ {
+ GlStateManager.func_179141_d();
+ }
+
+ protected void bindTexture(ResourceLocation location)
+ {
+ field_78298_i.func_110577_a(location);
+ }
+
+ protected IResource getResource(ResourceLocation location) throws IOException
+ {
+ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location);
+ }
+
public int func_175064_b(char p_175064_1_)
{
int i = "0123456789abcdef".indexOf(p_175064_1_);
@@ -1,32 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java
@@ -30,7 +30,8 @@
this.field_146292_n.add(new GuiButton(4, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 24 + -16, I18n.func_135052_a("menu.returnToGame")));
this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 96 + -16, 98, 20, I18n.func_135052_a("menu.options")));
- GuiButton guibutton = this.func_189646_b(new GuiButton(7, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + -16, 98, 20, I18n.func_135052_a("menu.shareToLan")));
+ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + i, 98, 20, I18n.func_135052_a("fml.menu.modoptions")));
+ GuiButton guibutton = this.func_189646_b(new GuiButton(7, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 72 + -16, 200, 20, I18n.func_135052_a("menu.shareToLan", new Object[0])));
guibutton.field_146124_l = this.field_146297_k.func_71356_B() && !this.field_146297_k.func_71401_C().func_71344_c();
this.field_146292_n.add(new GuiButton(5, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 48 + -16, 98, 20, I18n.func_135052_a("gui.advancements")));
this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 48 + -16, 98, 20, I18n.func_135052_a("gui.stats")));
@@ -73,13 +74,19 @@
this.field_146297_k.func_71381_h();
break;
case 5:
+ if (this.field_146297_k.field_71439_g != null)
this.field_146297_k.func_147108_a(new GuiScreenAdvancements(this.field_146297_k.field_71439_g.field_71174_a.func_191982_f()));
break;
case 6:
+ if (this.field_146297_k.field_71439_g != null)
this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m()));
break;
case 7:
this.field_146297_k.func_147108_a(new GuiShareToLan(this));
+ break;
+ case 12:
+ net.minecraftforge.fml.client.FMLClientHandler.instance().showInGameModOptions(this);
+ break;
}
}
@@ -1,19 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMultiplayer.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMultiplayer.java
@@ -41,6 +41,7 @@
public GuiMultiplayer(GuiScreen p_i1040_1_)
{
this.field_146798_g = p_i1040_1_;
+ net.minecraftforge.fml.client.FMLClientHandler.instance().setupServerList();
}
public void func_73866_w_()
@@ -375,7 +376,7 @@
private void func_146791_a(ServerData p_146791_1_)
{
- this.field_146297_k.func_147108_a(new GuiConnecting(this, this.field_146297_k, p_146791_1_));
+ net.minecraftforge.fml.client.FMLClientHandler.instance().connectToServer(this, p_146791_1_);
}
public void func_146790_a(int p_146790_1_)
@@ -1,12 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
@@ -189,6 +189,9 @@
long l = j - k;
List<String> list = Lists.newArrayList(String.format("Java: %s %dbit", System.getProperty("java.version"), this.field_175242_a.func_147111_S() ? 64 : 32), String.format("Mem: % 2d%% %03d/%03dMB", l * 100L / i, func_175240_a(l), func_175240_a(i)), String.format("Allocated: % 2d%% %03dMB", j * 100L / i, func_175240_a(j)), "", String.format("CPU: %s", OpenGlHelper.func_183029_j()), "", String.format("Display: %dx%d (%s)", Display.getWidth(), Display.getHeight(), GlStateManager.func_187416_u(7936)), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938));
+ list.add("");
+ list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
+
if (this.field_175242_a.func_189648_am())
{
return list;
-40
View File
@@ -1,40 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
@@ -421,9 +434,15 @@
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
{
+ net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre event = new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.field_146292_n);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
+ break;
+ guibutton = event.getButton();
this.field_146290_a = guibutton;
guibutton.func_146113_a(this.field_146297_k.func_147118_V());
this.func_146284_a(guibutton);
+ if (this.equals(this.field_146297_k.field_71462_r))
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.getButton(), this.field_146292_n));
}
}
}
@@ -473,7 +496,10 @@
{
while (Mouse.next())
{
+ this.mouseHandled = false;
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Pre(this))) continue;
this.func_146274_d();
+ if (this.equals(this.field_146297_k.field_71462_r) && !this.mouseHandled) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this));
}
}
@@ -481,7 +507,10 @@
{
while (Keyboard.next())
{
+ this.keyHandled = false;
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Pre(this))) continue;
this.func_146282_l();
+ if (this.equals(this.field_146297_k.field_71462_r) && !this.keyHandled) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this));
}
}
}
-65
View File
@@ -1,65 +0,0 @@
--- ../src-base/minecraft/net/minecraft/item/ItemBlock.java
+++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java
@@ -49,24 +49,12 @@
if (!itemstack.func_190926_b() && p_180614_1_.func_175151_a(p_180614_3_, p_180614_5_, itemstack) && p_180614_2_.func_190527_a(this.field_150939_a, p_180614_3_, false, p_180614_5_, (Entity)null))
{
int i = this.func_77647_b(itemstack.func_77960_j());
- IBlockState iblockstate1 = this.field_150939_a.func_180642_a(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_1_);
+ IBlockState iblockstate1 = this.field_150939_a.getStateForPlacement(p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, i, p_180614_1_, p_180614_4_);
- if (p_180614_2_.func_180501_a(p_180614_3_, iblockstate1, 11))
+ if (placeBlockAt(itemstack, p_180614_1_, p_180614_2_, p_180614_3_, p_180614_5_, p_180614_6_, p_180614_7_, p_180614_8_, iblockstate1))
{
iblockstate1 = p_180614_2_.func_180495_p(p_180614_3_);
-
- if (iblockstate1.func_177230_c() == this.field_150939_a)
- {
- func_179224_a(p_180614_2_, p_180614_1_, p_180614_3_, itemstack);
- this.field_150939_a.func_180633_a(p_180614_2_, p_180614_3_, iblockstate1, p_180614_1_, itemstack);
-
- if (p_180614_1_ instanceof EntityPlayerMP)
- {
- CriteriaTriggers.field_193137_x.func_193173_a((EntityPlayerMP)p_180614_1_, p_180614_3_, itemstack);
- }
- }
-
- SoundType soundtype = this.field_150939_a.func_185467_w();
+ SoundType soundtype = iblockstate1.func_177230_c().getSoundType(iblockstate1, p_180614_2_, p_180614_3_, p_180614_1_);
p_180614_2_.func_184133_a(p_180614_1_, p_180614_3_, soundtype.func_185841_e(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F);
itemstack.func_190918_g(1);
}
@@ -127,7 +115,7 @@
{
Block block = p_179222_1_.func_180495_p(p_179222_2_).func_177230_c();
- if (block == Blocks.field_150431_aC)
+ if (block == Blocks.field_150431_aC && block.func_176200_f(p_179222_1_, p_179222_2_))
{
p_179222_3_ = EnumFacing.UP;
}
@@ -171,6 +159,36 @@
+ /**
+ * Called to actually place the block, after the location is determined
+ * and all permission checks have been made.
+ *
+ * @param stack The item stack that was used to place the block. This can be changed inside the method.
+ * @param player The player who is placing the block. Can be null if the block is not being placed by a player.
+ * @param side The side the player (or machine) right-clicked on.
+ */
+ public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
+ {
+ if (!world.func_180501_a(pos, newState, 11)) return false;
+
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() == this.field_150939_a)
+ {
+ func_179224_a(world, player, pos, stack);
+ this.field_150939_a.func_180633_a(world, pos, state, player, stack);
+
+ if (player instanceof EntityPlayerMP)
+ CriteriaTriggers.field_193137_x.func_193173_a((EntityPlayerMP)player, pos, stack);
+ }
+
+ return true;
+ }
}
-22
View File
@@ -1,22 +0,0 @@
--- ../src-base/minecraft/net/minecraft/item/ItemSkull.java
+++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java
@@ -43,13 +43,18 @@
}
else
{
+ if (p_180614_2_.func_180495_p(p_180614_3_).func_177230_c().func_176200_f(p_180614_2_, p_180614_3_))
+ {
+ p_180614_5_ = EnumFacing.UP;
+ p_180614_3_ = p_180614_3_.func_177977_b();
+ }
IBlockState iblockstate = p_180614_2_.func_180495_p(p_180614_3_);
Block block = iblockstate.func_177230_c();
boolean flag = block.func_176200_f(p_180614_2_, p_180614_3_);
if (!flag)
{
- if (!p_180614_2_.func_180495_p(p_180614_3_).func_185904_a().func_76220_a())
+ if (!p_180614_2_.func_180495_p(p_180614_3_).func_185904_a().func_76220_a() && !p_180614_2_.isSideSolid(p_180614_3_, p_180614_5_, true))
{
return EnumActionResult.FAIL;
}
@@ -1,26 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/LoadingScreenRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/LoadingScreenRenderer.java
@@ -139,6 +139,10 @@
GlStateManager.func_179086_m(16640);
}
+ try
+ {
+ if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering
+ {
Tessellator tessellator = Tessellator.func_178181_a();
BufferBuilder bufferbuilder = tessellator.func_178180_c();
this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k);
@@ -174,6 +178,12 @@
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
this.field_73725_b.field_71466_p.func_175063_a(this.field_73726_c, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2), (float)(l / 2 - 4 - 16), 16777215);
this.field_73725_b.field_71466_p.func_175063_a(this.field_73727_a, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2), (float)(l / 2 - 4 + 8), 16777215);
+ }
+ }
+ catch (java.io.IOException e)
+ {
+ throw new RuntimeException(e);
+ } //FML End
this.field_146588_g.func_147609_e();
if (OpenGlHelper.func_148822_b())
-119
View File
@@ -1,119 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
@@ -536,23 +544,27 @@
- this.field_71446_o.func_147645_c(this.field_152354_ay);
+ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay);
this.field_152354_ay = null;
this.field_71461_s = new LoadingScreenRenderer(this);
this.field_184132_p = new DebugRenderer(this);
@@ -1630,6 +1653,11 @@
}
Display.setFullscreen(this.field_71431_Q);
+ if (!this.field_71431_Q) //Forge: Fix MC-68754, Screen is not resizeable after exiting fullscreen due to LWJGL bug https://github.com/LWJGL/lwjgl/issues/142 which is fixed, but not in the version MC ships
+ {
+ Display.setResizable(false);
+ Display.setResizable(true);
+ }
Display.setVSyncEnabled(this.field_71474_y.field_74352_v);
this.func_175601_h();
}
@@ -1982,6 +2013,7 @@
}
}
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput();
}
this.func_184117_aA();
@@ -2239,6 +2271,8 @@
{
while (Mouse.next())
{
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
+
int i = Mouse.getEventButton();
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
@@ -2294,6 +2328,7 @@
this.field_71462_r.func_146274_d();
}
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput();
}
}
@@ -2304,6 +2339,7 @@
public void func_71371_a(String p_71371_1_, String p_71371_2_, @Nullable WorldSettings p_71371_3_)
{
+ net.minecraftforge.fml.client.FMLClientHandler.instance().startIntegratedServer(p_71371_1_, p_71371_2_, p_71371_3_);
this.func_71403_a((WorldClient)null);
System.gc();
ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
@@ -2344,8 +2380,14 @@
this.field_71461_s.func_73720_a(I18n.func_135052_a("menu.loadingLevel"));
- while (!this.field_71437_Z.func_71200_ad())
+ while (!this.field_71437_Z.func_71200_ad() && !this.field_71437_Z.func_71241_aa())
{
+ if (!net.minecraftforge.fml.common.StartupQuery.check())
+ {
+ func_71403_a(null);
+ func_147108_a(null);
+ return;
+ }
String s = this.field_71437_Z.func_71195_b_();
if (s != null)
@@ -2395,6 +2445,18 @@
if (this.field_71437_Z != null && this.field_71437_Z.func_175578_N())
{
this.field_71437_Z.func_71263_m();
+ if (field_71461_s != null && this.field_71425_J)
+ {
+ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal"));
+ }
+ while (!field_71437_Z.func_71241_aa())
+ {
+ try
+ {
+ Thread.sleep(10);
+ }
+ catch (InterruptedException ie) {}
+ }
}
this.field_71437_Z = null;
@@ -2418,6 +2480,7 @@
this.field_71456_v.func_181029_i();
this.func_71351_a((ServerData)null);
this.field_71455_al = false;
+ net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.field_71441_e);
}
this.field_147127_av.func_147690_c();
@@ -3181,11 +3089,11 @@
{
if (Keyboard.getEventKeyState())
{
- if (i == this.field_71474_y.field_152395_am.func_151463_i())
+ if (this.field_71474_y.field_152395_am.isActiveAndMatches(i))
{
this.func_71352_k();
}
- else if (i == this.field_71474_y.field_151447_Z.func_151463_i())
+ else if (this.field_71474_y.field_151447_Z.isActiveAndMatches(i))
{
this.field_71456_v.func_146158_b().func_146227_a(ScreenShotHelper.func_148260_a(this.field_71412_D, this.field_71443_c, this.field_71440_d, this.field_147124_at));
}
@@ -3199,6 +3107,7 @@
}
}
}
+ else if (this.field_71462_r instanceof GuiControls) ((GuiControls)this.field_71462_r).field_146491_f = null;
}
}
}
@@ -1,20 +0,0 @@
--- ../src-base/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java
+++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java
@@ -69,7 +69,7 @@
if (entityplayermp == null)
{
this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT;
- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_181025_l);
+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_181025_l);
this.field_181025_l = null;
}
}
@@ -132,7 +132,7 @@
}
else
{
- this.field_147327_f.func_184103_al().func_72355_a(this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i));
+ net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_184103_al(), this.field_147333_a, this.field_147327_f.func_184103_al().func_148545_a(this.field_147337_i));
}
}
}
@@ -1,29 +0,0 @@
--- ../src-base/minecraft/net/minecraft/network/NetworkManager.java
+++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java
@@ -204,7 +209,7 @@
final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(p_150732_1_);
final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.field_150746_k.attr(field_150739_c).get();
- if (enumconnectionstate1 != enumconnectionstate)
+ if (enumconnectionstate1 != enumconnectionstate && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket))
{
field_150735_g.debug("Disabled auto read");
this.field_150746_k.config().setAutoRead(false);
@@ -212,7 +217,7 @@
if (this.field_150746_k.eventLoop().inEventLoop())
{
- if (enumconnectionstate != enumconnectionstate1)
+ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket))
{
this.func_150723_a(enumconnectionstate);
}
@@ -232,7 +237,7 @@
{
public void run()
{
- if (enumconnectionstate != enumconnectionstate1)
+ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof net.minecraftforge.fml.common.network.internal.FMLProxyPacket))
{
NetworkManager.this.func_150723_a(enumconnectionstate);
}
-21
View File
@@ -1,21 +0,0 @@
--- ../src-base/minecraft/net/minecraft/server/management/PlayerList.java
+++ ../src-work/minecraft/net/minecraft/server/management/PlayerList.java
@@ -106,7 +106,7 @@
this.field_72405_c = 8;
}
- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_)
+ public void initializeConnectionToPlayer(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_, NetHandlerPlayServer nethandlerplayserver)
{
GameProfile gameprofile = p_72355_2_.func_146103_bH();
PlayerProfileCache playerprofilecache = this.field_72400_f.func_152358_ax();
@@ -127,8 +138,9 @@
WorldServer worldserver = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK);
WorldInfo worldinfo = worldserver.func_72912_H();
this.func_72381_a(p_72355_2_, (EntityPlayerMP)null, worldserver);
- NetHandlerPlayServer nethandlerplayserver = new NetHandlerPlayServer(this.field_72400_f, p_72355_1_, p_72355_2_);
+ p_72355_2_.field_71135_a = nethandlerplayserver;
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireServerConnectionEvent(p_72355_1_);
nethandlerplayserver.func_147359_a(new SPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).func_180714_a(this.func_72365_p().getServerModName())));
nethandlerplayserver.func_147359_a(new SPacketServerDifficulty(worldinfo.func_176130_y(), worldinfo.func_176123_z()));
nethandlerplayserver.func_147359_a(new SPacketPlayerAbilities(p_72355_2_.field_71075_bZ));
@@ -1,21 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java
+++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java
@@ -127,8 +127,9 @@
}
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().confirmBackupLevelDatUse(this);
file1 = new File(this.field_75770_b, "level.dat_old");
return file1.exists() ? SaveFormatOld.func_186353_a(file1, this.field_186341_a) : null;
}
public void func_75755_a(WorldInfo p_75755_1_, @Nullable NBTTagCompound p_75755_2_)
@@ -137,6 +138,8 @@
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.func_74782_a("Data", nbttagcompound);
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().handleWorldDataSave(this, p_75755_1_, nbttagcompound1);
+
try
{
File file1 = new File(this.field_75770_b, "level.dat_new");
@@ -1,23 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
+++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
@@ -83,7 +83,7 @@
boolean flag1 = this.field_148301_e.field_82821_f < 340;
boolean flag2 = flag || flag1;
this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_192634_2_ + 32 + 3, p_192634_3_ + 1, 16777215);
- List<String> list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_192634_4_ - 32 - 2);
+ List<String> list = this.field_148300_d.field_71466_p.func_78271_c(net.minecraftforge.fml.client.FMLClientHandler.instance().fixDescription(this.field_148301_e.field_78843_d), p_192634_4_ - 32 - 2);
for (int i = 0; i < Math.min(list.size(), 2); ++i)
{
@@ -177,6 +177,11 @@
int i1 = p_192634_6_ - p_192634_2_;
int j1 = p_192634_7_ - p_192634_3_;
+ String tooltip = net.minecraftforge.fml.client.FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, p_192634_2_, p_192634_4_, p_192634_3_, i1, j1);
+ if (tooltip != null)
+ {
+ this.field_148303_c.func_146793_a(tooltip);
+ } else
if (i1 >= p_192634_4_ - 15 && i1 <= p_192634_4_ - 5 && j1 >= 0 && j1 <= 8)
{
this.field_148303_c.func_146793_a(s1);
-150
View File
@@ -1,150 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/World.java
+++ ../src-work/minecraft/net/minecraft/world/World.java
@@ -527,11 +579,11 @@
{
IBlockState iblockstate = this.func_180495_p(p_190529_1_);
- if (iblockstate.func_177230_c() == Blocks.field_190976_dk)
+ if (true)
{
try
{
- ((BlockObserver)iblockstate.func_177230_c()).func_190962_b(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
+ iblockstate.func_177230_c().observedNeighborChange(iblockstate, this, p_190529_1_, p_190529_2_, p_190529_3_);
}
catch (Throwable throwable)
{
@@ -543,7 +595,7 @@
{
try
{
- return String.format("ID #%d (%s // %s)", Block.func_149682_b(p_190529_2_), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getCanonicalName());
+ return String.format("ID #%d (%s // %s // %s)", Block.func_149682_b(p_190529_2_), p_190529_2_.func_149739_a(), p_190529_2_.getClass().getName(), p_190529_2_.getRegistryName());
}
catch (Throwable var2)
{
@@ -1227,6 +1291,7 @@
IBlockState iblockstate = Blocks.field_150348_b.func_176223_P();
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.func_185346_s();
+ if (p_191504_3_ && !net.minecraftforge.event.ForgeEventFactory.gatherCollisionBoxes(this, p_191504_1_, p_191504_2_, p_191504_4_)) return true;
try
{
for (int k1 = i; k1 < j; ++k1)
@@ -1269,7 +1334,7 @@
iblockstate1.func_185908_a(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);
- if (p_191504_3_ && !p_191504_4_.isEmpty())
+ if (p_191504_3_ && !net.minecraftforge.event.ForgeEventFactory.gatherCollisionBoxes(this, p_191504_1_, p_191504_2_, p_191504_4_))
{
boolean flag5 = true;
return flag5;
@@ -1319,11 +1384,10 @@
}
}
}
-
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.GetCollisionBoxesEvent(this, p_184144_1_, p_184144_2_, list));
return list;
}
@@ -1522,9 +1620,9 @@
for (blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1)
{
blockpos1 = blockpos.func_177977_b();
- Material material = chunk.func_177435_g(blockpos1).func_185904_a();
+ IBlockState state = chunk.func_177435_g(blockpos1);
- if (material.func_76230_c() && material != Material.field_151584_j)
+ if (state.func_185904_a().func_76230_c() && !state.func_177230_c().isLeaves(state, this, blockpos1) && !state.func_177230_c().isFoliage(this, blockpos1))
{
break;
}
@@ -1972,6 +2128,12 @@
{
IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
+ Boolean result = iblockstate1.func_177230_c().isAABBInsideLiquid(this, blockpos$pooledmutableblockpos, p_72953_1_);
+ if (result != null) {
+ if (!result) continue;
+ blockpos$pooledmutableblockpos.func_185344_t();
+ return true;
+ }
if (iblockstate1.func_185904_a().func_76224_d())
{
blockpos$pooledmutableblockpos.func_185344_t();
@@ -2050,6 +2217,16 @@
IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos);
Block block = iblockstate1.func_177230_c();
+ Boolean result = block.isEntityInsideMaterial(this, blockpos$pooledmutableblockpos, iblockstate1, p_72918_3_, (double)i3, p_72918_2_, false);
+ if (result != null && result == true)
+ {
+ // Forge: When requested call blocks modifyAcceleration method, and more importantly cause this method to return true, which results in an entity being "inWater"
+ flag = true;
+ vec3d = block.func_176197_a(this, blockpos$pooledmutableblockpos, p_72918_3_, vec3d);
+ continue;
+ }
+ else if (result != null && result == false) continue;
+
if (iblockstate1.func_185904_a() == p_72918_2_)
{
double d0 = (double)((float)(i4 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate1.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
@@ -2095,7 +2272,14 @@
{
for (int j4 = j3; j4 < k3; ++j4)
{
- if (this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4)).func_185904_a() == p_72875_2_)
+ IBlockState iblockstate1 = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(l3, i4, j4));
+ Boolean result = iblockstate1.func_177230_c().isAABBInsideMaterial(this, blockpos$pooledmutableblockpos, p_72875_1_, p_72875_2_);
+ if (result != null) {
+ if (!result) continue;
+ blockpos$pooledmutableblockpos.func_185344_t();
+ return true;
+ }
+ if (iblockstate1.func_185904_a() == p_72875_2_)
{
blockpos$pooledmutableblockpos.func_185344_t();
return true;
@@ -2484,6 +2687,11 @@
public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_)
{
+ return this.field_73011_w.canBlockFreeze(p_175670_1_, p_175670_2_);
+ }
+
+ public boolean canBlockFreezeBody(BlockPos p_175670_1_, boolean p_175670_2_)
+ {
Biome biome = this.func_180494_b(p_175670_1_);
float f = biome.func_180626_a(p_175670_1_);
@@ -2525,6 +2733,11 @@
public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_)
{
+ return this.field_73011_w.canSnowAt(p_175708_1_, p_175708_2_);
+ }
+
+ public boolean canSnowAtBody(BlockPos p_175708_1_, boolean p_175708_2_)
+ {
Biome biome = this.func_180494_b(p_175708_1_);
float f = biome.func_180626_a(p_175708_1_);
@@ -2542,7 +2755,7 @@
{
IBlockState iblockstate1 = this.func_180495_p(p_175708_1_);
- if (iblockstate1.func_185904_a() == Material.field_151579_a && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_))
+ if (iblockstate1.func_177230_c().isAir(iblockstate1, this, p_175708_1_) && Blocks.field_150431_aC.func_176196_c(this, p_175708_1_))
{
return true;
}
@@ -2958,7 +3175,7 @@
}
else
{
- return iblockstate1.func_185904_a().func_76222_j() && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_);
+ return iblockstate1.func_177230_c().func_176200_f(this, p_190527_2_) && p_190527_1_.func_176198_a(this, p_190527_2_, p_190527_4_);
}
}
@@ -1,12 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenLakes.java
@@ -161,7 +161,8 @@
if (p_180709_1_.func_175675_v(p_180709_3_.func_177982_a(k2, 4, l3)))
{
- p_180709_1_.func_180501_a(p_180709_3_.func_177982_a(k2, 4, l3), Blocks.field_150432_aD.func_176223_P(), 2);
+ int flag = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 2| 16 : 2; //Forge: With bit 5 unset, it will notify neighbors and load adjacent chunks.
+ p_180709_1_.func_180501_a(p_180709_3_.func_177982_a(k2, 4, l3), Blocks.field_150432_aD.func_176223_P(), flag); //Forge
}
}
}
@@ -1,12 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java
+++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenerator.java
@@ -33,7 +33,8 @@
}
else
{
- p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, 2);
+ int flag = net.minecraftforge.common.ForgeModContainer.fixVanillaCascading ? 2| 16 : 2; //Forge: With bit 5 unset, it will notify neighbors and load adjacent chunks.
+ p_175903_1_.func_180501_a(p_175903_2_, p_175903_3_, flag);
}
}
}
-51
View File
@@ -1,51 +0,0 @@
--- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java
+++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java
@@ -63,8 +63,9 @@
private double field_176153_H = 0.2D;
private int field_176154_I = 5;
private int field_176155_J = 15;
private GameRules field_82577_x = new GameRules();
+ private java.util.Map<String, net.minecraft.nbt.NBTBase> additionalProperties;
protected WorldInfo()
{
@@ -366,6 +367,7 @@
p_76064_1_.func_74780_a("BorderSizeLerpTarget", this.field_176148_F);
p_76064_1_.func_74780_a("BorderWarningBlocks", (double)this.field_176154_I);
p_76064_1_.func_74780_a("BorderWarningTime", (double)this.field_176155_J);
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().getDataFixer().writeVersionData(p_76064_1_);
if (this.field_176158_z != null)
{
@@ -708,6 +711,7 @@
public void func_176144_a(EnumDifficulty p_176144_1_)
{
+ net.minecraftforge.common.ForgeHooks.onDifficultyChange(p_176144_1_, this.field_176158_z);
this.field_176158_z = p_176144_1_;
}
@@ -805,18 +809,49 @@
}
});
}
+ /**
+ * Allow access to additional mod specific world based properties
+ * Used by FML to store mod list associated with a world, and maybe an id map
+ * Used by Forge to store the dimensions available to a world
+ * @param additionalProperties
+ */
+ public void setAdditionalProperties(java.util.Map<String,net.minecraft.nbt.NBTBase> additionalProperties)
+ {
+ // one time set for this
+ if (this.additionalProperties == null)
+ {
+ this.additionalProperties = additionalProperties;
+ }
+ }
+ public net.minecraft.nbt.NBTBase getAdditionalProperty(String additionalProperty)
+ {
+ return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null;
+ }
+
Loaded 100 of 353 files, more files were not shown because too many files have changed in this diff. Show more